##// END OF EJS Templates
test-pathencode: compare current pathencoding implementations...
Adrian Buehlmann -
r18094:8ceabb34 default
parent child Browse files
Show More
@@ -13,9 +13,6 b' import collections'
13 if sys.version_info[:2] < (2, 6):
13 if sys.version_info[:2] < (2, 6):
14 sys.exit(0)
14 sys.exit(0)
15
15
16 def hybridencode(path):
17 return store._hybridencode(path, True)
18
19 validchars = set(map(chr, range(0, 256)))
16 validchars = set(map(chr, range(0, 256)))
20 alphanum = range(ord('A'), ord('Z'))
17 alphanum = range(ord('A'), ord('Z'))
21
18
@@ -157,7 +154,15 b' def genpath(rng, count):'
157 def runtests(rng, seed, count):
154 def runtests(rng, seed, count):
158 nerrs = 0
155 nerrs = 0
159 for p in genpath(rng, count):
156 for p in genpath(rng, count):
160 hybridencode(p)
157 h = store._dothybridencode(p) # uses C implementation, if available
158 r = store._hybridencode(p, True) # reference implementation in Python
159 if h != r:
160 if nerrs == 0:
161 print >> sys.stderr, 'seed:', hex(seed)[:-1]
162 print >> sys.stderr, "\np: '%s'" % p.encode("string_escape")
163 print >> sys.stderr, "h: '%s'" % h.encode("string_escape")
164 print >> sys.stderr, "r: '%s'" % r.encode("string_escape")
165 nerrs += 1
161 return nerrs
166 return nerrs
162
167
163 def main():
168 def main():
General Comments 0
You need to be logged in to leave comments. Login now