[PATCH 4 of 5 RFC v2] tests: require regexes in unified tests to be marked with " (re)"

Adrian Buehlmann adrian at cadifra.com
Wed Sep 22 16:51:59 CDT 2010


On 22.09.2010 23:11, Brodie Rao wrote:
> # HG changeset patch
> # User Brodie Rao <brodie at bitheap.org>
> # Date 1285189560 18000
> # Node ID e9edab4d5810f8f3683c0f522b03d99f4e23e910
> # Parent  7bbb17c78894015db067a7a3fec3fb6ddef440ec
> tests: require regexes in unified tests to be marked with " (re)"
> 
> Consider this test:
> 
>   $ hg glog --template '{rev}:{node|short} "{desc}"\n'
>   @  2:20c4f79fd7ac "3"
>   |
>   | o  1:38f24201dcab "2"
>   |/
>   o  0:2a18120dc1c9 "1"
> 
> Because each line beginning with "|" can be compiled as a regular
> expression (equivalent to ".*|"), they will match any output.
> 
> Similarly:
> 
>   $ echo foo
> 
> 
> The blank output line can be compiled as a regular expression and will
> also match any output.
> 
> With this patch, none of the above output lines will be matched as
> regular expressions. A line must end in " (re)" in order to be matched
> as one.
> 
> Lines are still matched literally first, so the following will pass:
> 
>   $ echo 'foo (re)'
>   foo (re)
> 

Looks good. I think we at least need this.


More information about the Mercurial-devel mailing list