[PATCH 6 of 7 resend] tests: ensure that C and Python path encoding agree

Bryan O'Sullivan bos at serpentine.com
Wed Dec 12 15:11:01 CST 2012


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1355346577 28800
# Node ID b23eec6a55ee3292b46abdb980adf9d9096d3e1f
# Parent  9fcae4777e797bd8ec8f968b4fde7a148e0963c0
tests: ensure that C and Python path encoding agree

diff --git a/tests/test-pathencode.py b/tests/test-pathencode.py
--- a/tests/test-pathencode.py
+++ b/tests/test-pathencode.py
@@ -157,7 +157,15 @@ def genpath(rng, count):
 def runtests(rng, seed, count):
     nerrs = 0
     for p in genpath(rng, count):
-        hybridencode(p)
+        he = hybridencode(p)
+        pe = parsers.pathencode(p)
+        if pe != he:
+            if nerrs == 0:
+                print >> sys.stderr, 'seed:', hex(seed)[:-1]
+            print >> sys.stderr, repr(p)
+            print >> sys.stderr, '  hybrid %r' % he
+            print >> sys.stderr, '  path   %r' % pe
+            nerrs += 1
     return nerrs
 
 def main():


More information about the Mercurial-devel mailing list