Mercurial > public > mercurial-scm > hg-stable
diff tests/test-linelog.py @ 38849:57af5ee15b35
linelog: port to Python 3
Differential Revision: https://phab.mercurial-scm.org/D4051
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 01 Aug 2018 23:25:35 -0400 |
parents | 422d661056be |
children | 6fed8b323651 |
line wrap: on
line diff
--- a/tests/test-linelog.py Sat Jul 28 17:42:36 2018 -0700 +++ b/tests/test-linelog.py Wed Aug 01 23:25:35 2018 -0400 @@ -41,12 +41,12 @@ self.assertEqual(linelog.linelog.fromdata(enc), ll) # This encoding matches the encoding used by hg-experimental's # linelog file, or is supposed to if it doesn't. - self.assertEqual(enc, ('\x00\x00\x01\x90\x00\x00\x00\x06' - '\x00\x00\x00\xa4\x00\x00\x00*' - '\x00\x00\x00\x00\x00\x00\x00+' - '\x00\x00\x00\x00\x00\x00\x00\x00' - '\x00\x00\x00\xb1\x00\x00\x00-' - '\x00\x00\x00\xba\x00\x00\x00/')) + self.assertEqual(enc, (b'\x00\x00\x01\x90\x00\x00\x00\x06' + b'\x00\x00\x00\xa4\x00\x00\x00*' + b'\x00\x00\x00\x00\x00\x00\x00+' + b'\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00\x00\x00\xb1\x00\x00\x00-' + b'\x00\x00\x00\xba\x00\x00\x00/')) def testsimpleedits(self): ll = linelog.linelog() @@ -94,21 +94,21 @@ def testparseclinelogfile(self): # This data is what the replacements in testsimpleedits # produce when fed to the original linelog.c implementation. - data = ('\x00\x00\x00\x0c\x00\x00\x00\x0f' - '\x00\x00\x00\x00\x00\x00\x00\x02' - '\x00\x00\x00\x05\x00\x00\x00\x06' - '\x00\x00\x00\x06\x00\x00\x00\x00' - '\x00\x00\x00\x00\x00\x00\x00\x07' - '\x00\x00\x00\x06\x00\x00\x00\x02' - '\x00\x00\x00\x00\x00\x00\x00\x00' - '\x00\x00\x00\t\x00\x00\x00\t' - '\x00\x00\x00\x00\x00\x00\x00\x0c' - '\x00\x00\x00\x08\x00\x00\x00\x05' - '\x00\x00\x00\x06\x00\x00\x00\x01' - '\x00\x00\x00\x00\x00\x00\x00\x05' - '\x00\x00\x00\x0c\x00\x00\x00\x05' - '\x00\x00\x00\n\x00\x00\x00\x01' - '\x00\x00\x00\x00\x00\x00\x00\t') + data = (b'\x00\x00\x00\x0c\x00\x00\x00\x0f' + b'\x00\x00\x00\x00\x00\x00\x00\x02' + b'\x00\x00\x00\x05\x00\x00\x00\x06' + b'\x00\x00\x00\x06\x00\x00\x00\x00' + b'\x00\x00\x00\x00\x00\x00\x00\x07' + b'\x00\x00\x00\x06\x00\x00\x00\x02' + b'\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00\x00\x00\t\x00\x00\x00\t' + b'\x00\x00\x00\x00\x00\x00\x00\x0c' + b'\x00\x00\x00\x08\x00\x00\x00\x05' + b'\x00\x00\x00\x06\x00\x00\x00\x01' + b'\x00\x00\x00\x00\x00\x00\x00\x05' + b'\x00\x00\x00\x0c\x00\x00\x00\x05' + b'\x00\x00\x00\n\x00\x00\x00\x01' + b'\x00\x00\x00\x00\x00\x00\x00\t') llc = linelog.linelog.fromdata(data) self.assertEqual([(l.rev, l.linenum) for l in llc.annotate(1)], [(1, 0),