Patchwork D4184: tests: add test coverage for revlogindex[-1] which was previously missing

login
register
mail settings
Submitter phabricator
Date Aug. 9, 2018, 5:46 p.m.
Message ID <6f341668886f1c18620a77c4ff4e0575@localhost.localdomain>
Download mbox | patch
Permalink /patch/33476/
State Not Applicable
Headers show

Comments

phabricator - Aug. 9, 2018, 5:46 p.m.
durin42 updated this revision to Diff 10126.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4184?vs=10118&id=10126

REVISION DETAIL
  https://phab.mercurial-scm.org/D4184

AFFECTED FILES
  tests/test-parseindex2.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-parseindex2.py b/tests/test-parseindex2.py
--- a/tests/test-parseindex2.py
+++ b/tests/test-parseindex2.py
@@ -207,6 +207,16 @@ 
                 # pure version doesn't support this
                 break
 
+    def testminusone(self):
+        want = (0, 0, 0, -1, -1, -1, -1, nullid)
+        index, junk = parsers.parse_index2(data_inlined, True)
+        got = index[-1]
+        self.assertEqual(want, got) # inline data
+
+        index, junk = parsers.parse_index2(data_non_inlined, False)
+        got = index[-1]
+        self.assertEqual(want, got) # no inline data
+
 if __name__ == '__main__':
     import silenttestrunner
     silenttestrunner.main(__name__)