# HG changeset patch # User Augie Fackler # Date 2018-08-09 17:20:42 # Node ID daedb70fd467e7fe4ea360cde2206ea9c18b7a54 # Parent 2488dcfa71f8671b7ba0d13f5ffad2ffda17a40c tests: add test coverage for revlogindex[-1] which was previously missing Differential Revision: https://phab.mercurial-scm.org/D4184 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 @@ class parseindex2tests(unittest.TestCase # 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__)