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

Adrian Buehlmann adrian at cadifra.com
Wed Nov 14 01:47:39 CST 2012


On 2012-11-13 23:00, Bryan O'Sullivan wrote:
> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1352842986 28800
> # Node ID aed962e149d47bb8e42ed140f1deae19c7078f5b
> # Parent  d7177075d40bb0876695cf0532d8575829ac7800
> 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
> @@ -154,7 +154,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():

Would it make sense to have patch 1 and 7 in first, so that we have this
new testing in place for the current implementations (C and Python path
encoding) already?

I mean before really changing anything on implementations.

The probabilistic test looks pretty interesting and I think it would be
valuable on its own already, combining it with what we have.




More information about the Mercurial-devel mailing list