comparison tests/test-pathencode.py @ 19318:9778c77f05d6 stable

test-pathencode: reduce makepart length requirement by 1 This allows path components of length 1 to be generated.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 19 Jun 2013 23:01:22 -0700
parents 8c019d2fd7c0
children ec17ddecdf64
comparison
equal deleted inserted replaced
19317:66da6e9feacd 19318:9778c77f05d6
123 '''Construct a part of a pathname, without slashes.''' 123 '''Construct a part of a pathname, without slashes.'''
124 124
125 p = pickfrom(rng, firsttable)(rng) 125 p = pickfrom(rng, firsttable)(rng)
126 l = len(p) 126 l = len(p)
127 ps = [p] 127 ps = [p]
128 while l <= k: 128 while l < k:
129 p = pickfrom(rng, resttable)(rng) 129 p = pickfrom(rng, resttable)(rng)
130 l += len(p) 130 l += len(p)
131 ps.append(p) 131 ps.append(p)
132 ps.append(pickfrom(rng, lasttable)(rng)) 132 ps.append(pickfrom(rng, lasttable)(rng))
133 return ''.join(ps) 133 return ''.join(ps)