[PATCH] test-subrepo-git.t: adapt for Windows
Adrian Buehlmann
adrian at cadifra.com
Tue Jun 19 23:26:47 UTC 2012
On 2012-06-20 01:05, Eduard-Cristian Stefan wrote:
> On 2012-06-20 01:41, Eduard-Cristian Stefan wrote:
>> On 2012-06-20 00:22, Adrian Buehlmann wrote:
>>>> + $ hg forget 'notafile'
>>>> + notafile: No such file or directory
>>>> [1]
>>>> +#elsif
>>>
>>> That's basically a syntax error here (only #else is implemented), but
>>> run-tests.py will parse it as a comment, it will thus continue to skip
>>> the following commands (and output lines) if run on Windows, until the
>>> #endif is reached. In other words: your #elsif is ignored.
>>
>> My mistake.
>
> But why does it enter the #elseif branch? For:
>
> #if unix-permissions
> $ hg forget 'notafile'
> $ hg version
> notafile: No such file or directory
> [1]
> #elseif
> $ hg forget 'notafile'
> $ hg version
> notafile: * (glob)
> [1]
> #endif
>
> the result is:
>
> --- d:\hg\tests\test-subrepo-git.t
> +++ d:\hg\tests\test-subrepo-git.t.err
> @@ -518,9 +518,15 @@
> [1]
> #elseif
> $ hg forget 'notafile'
> + notafile: The system cannot find the file specified
> + [1]
> $ hg version
> - notafile: * (glob)
> - [1]
> + Mercurial Distributed SCM (version 2.2.2+133-132ea1736751+20120619)
> + (see http://mercurial.selenic.com for more information)
> +
> + Copyright (C) 2005-2012 Matt Mackall and others
> + This is free software; see the source for copying conditions. There is NO
> + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> #endif
>
> $ cd ..
>
> ERROR: d:\hg\tests\test-subrepo-git.t output changed
> !
> Failed test-subrepo-git.t: output changed
> # Ran 1 tests, 0 skipped, 1 failed.
>
> Is it because #elseif is treated like an #else ?
Your conclusion is correct, yes.
See http://selenic.com/repo/hg/file/132ea1736751/tests/run-tests.py#l628
The parsing done there is very simplistic. But I think it's good enough
for our purpose.
More information about the Mercurial-devel
mailing list