[PATCH] parsers: clarify documentation of test-parseindex2.py

Chris Jerdonek chris.jerdonek at gmail.com
Mon Dec 2 10:12:52 CST 2013


# HG changeset patch
# User Chris Jerdonek <chris.jerdonek at gmail.com>
# Date 1385999389 28800
#      Mon Dec 02 07:49:49 2013 -0800
# Node ID ef470104ed72731dc20b7f2af3ced3144168a5ee
# Parent  1c92524c37cdd251c1a36b2da0fb4148b0e6ba09
parsers: clarify documentation of test-parseindex2.py

This change updates and improves the description of test-parseindex2.py.
In particular, it removes language that can be interpreted to mean that the
test module checks only the C implementation of parsers.parse_index2().
Rather, the module checks parsers.parse_index2(), which can be either the
C or pure Python implementation, depending on which version is being used.

As of e57c532c3835, the module also does more than just compare the return
value with the original Python implementation.

diff --git a/tests/test-parseindex2.py b/tests/test-parseindex2.py
--- a/tests/test-parseindex2.py
+++ b/tests/test-parseindex2.py
@@ -1,11 +1,9 @@
+"""This unit test tests parsers.parse_index2()."""
+
 from mercurial import parsers
 from mercurial.node import nullid, nullrev
 import struct
 
-# This unit test compares the return value of the original Python
-# implementation of parseindex and the new C implementation for
-# an index file with and without inlined data
-
 # original python implementation
 def gettype(q):
     return int(q & 0xFFFF)
@@ -106,6 +104,9 @@
     else:
         print "Expected to get TypeError."
 
+   # Check parsers.parse_index2() on an index file against the original
+   # Python implementation of parseindex, both with and without inlined data.
+
     py_res_1 = py_parseindex(data_inlined, True)
     c_res_1 = parse_index2(data_inlined, True)
 


More information about the Mercurial-devel mailing list