tests/test-parseindex2.py
changeset 38993 ee0720e82257
parent 38992 94cff858b4e5
child 39045 88b04bd2cbb4
equal deleted inserted replaced
38992:94cff858b4e5 38993:ee0720e82257
   182     def testparseindexfile(self):
   182     def testparseindexfile(self):
   183         # Check parsers.parse_index2() on an index file against the
   183         # Check parsers.parse_index2() on an index file against the
   184         # original Python implementation of parseindex, both with and
   184         # original Python implementation of parseindex, both with and
   185         # without inlined data.
   185         # without inlined data.
   186 
   186 
   187         py_res_1 = py_parseindex(data_inlined, True)
   187         want = py_parseindex(data_inlined, True)
   188         c_res_1 = parse_index2(data_inlined, True)
   188         got = parse_index2(data_inlined, True)
   189         self.assertEqual(py_res_1, c_res_1) # inline data
   189         self.assertEqual(want, got) # inline data
   190 
   190 
   191         py_res_2 = py_parseindex(data_non_inlined, False)
   191         want = py_parseindex(data_non_inlined, False)
   192         c_res_2 = parse_index2(data_non_inlined, False)
   192         got = parse_index2(data_non_inlined, False)
   193         self.assertEqual(py_res_2, c_res_2) # no inline data
   193         self.assertEqual(want, got) # no inline data
   194 
   194 
   195         ix = parsers.parse_index2(data_inlined, True)[0]
   195         ix = parsers.parse_index2(data_inlined, True)[0]
   196         for i, r in enumerate(ix):
   196         for i, r in enumerate(ix):
   197             if r[7] == nullid:
   197             if r[7] == nullid:
   198                 i = -1
   198                 i = -1