[PATCH] check-code: replace heredocs in unified tests

Adrian Buehlmann adrian at cadifra.com
Mon Oct 8 03:12:47 CDT 2012


(+cc Augie)

Looks nice to me.

Augie, could you please take this? Thanks.

On 2012-10-03 22:11, Idan Kamara wrote:
> # HG changeset patch
> # User Idan Kamara <idankk86 at gmail.com>
> # Date 1349294958 -7200
> # Node ID 9fb57ed368fee623a34d8ee332b8f39dcb33697e
> # Parent  fa714f3ed2989aff64c267c9935251d9fc4f31ee
> check-code: replace heredocs in unified tests
> 
> Heredocs are usually fed to other commands and
> shouldn't follow the standard conventions of shell
> commands.
> 
> This restores the old behaviour of how heredocs
> were handled in old-style test files.
> 
> diff --git a/contrib/check-code.py b/contrib/check-code.py
> --- a/contrib/check-code.py
> +++ b/contrib/check-code.py
> @@ -116,6 +116,7 @@
>          utestpats[i].append((p, m))
>  
>  utestfilters = [
> +    (r"<<(\S+)((.|\n)*?\n  > \1)", rephere),
>      (r"( *)(#([^\n]*\S)?)", repcomment),
>  ]
>  
> diff --git a/tests/test-check-code-hg.t b/tests/test-check-code-hg.t
> --- a/tests/test-check-code-hg.t
> +++ b/tests/test-check-code-hg.t
> @@ -162,19 +162,6 @@
>    tests/autodiff.py:0:
>     >         ui.write('data lost for: %s\n' % fn)
>     warning: unwrapped ui message
> -  tests/test-convert-mtn.t:0:
> -   >   > function get_passphrase(keypair_id)
> -   don't use 'function', use old style
> -  tests/test-import-git.t:0:
> -   >   > Mc\${NkU|\`?^000jF3jhEB
> -   ^ must be quoted
> -  tests/test-import.t:0:
> -   >   > diff -Naur proj-orig/foo proj-new/foo
> -   don't use 'diff -N'
> -   don't use 'diff -N'
> -  tests/test-schemes.t:0:
> -   >   > z = file:\$PWD/
> -   don't use $PWD, use `pwd`
>    tests/test-ui-color.py:0:
>     > testui.warn('warning\n')
>     warning: unwrapped ui message
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list