[PATCH 01 of 14] tests: roll test-committer.t into test-commit.t
Adrian Buehlmann
adrian at cadifra.com
Fri Jun 8 16:32:23 CDT 2012
On 2012-06-08 23:25, Adrian Buehlmann wrote:
> On 2012-06-08 22:07, Mads Kiilerich wrote:
>> Adrian Buehlmann wrote, On 06/08/2012 07:02 PM:
>>> On 2012-06-08 18:07, Martin Geisler wrote:
>>>>> diff --git a/tests/test-commit.t b/tests/test-commit.t
>>>>> --- a/tests/test-commit.t
>>>>> +++ b/tests/test-commit.t
>>>>> @@ -106,7 +106,8 @@
>>>>> [255]
>>>>>
>>>>> $ cd ..
>>>>> -
>>>>> + $ pwd
>>>>> + $TESTTMP
>>>> Is this there on purpose? I don't see what it tests.
>>>>
>>> It is on purpose.
>>>
>>> Some tests had errors with incorrectly matched cd of the sort
>>>
>>> $ cd foo
>>> ...
>>> $ cd ..
>>> ...
>>> $ cd ..
>>>
>>> which resultet in cd'ing way too high up. That check makes sure that
>>> this doesn't happen again if someone edits the test later on.
>>
>> I think it would be better to make it a general rule to avoid doing 'cd
>> ..' and instead do 'cd $TESTDIR'.
>
> Agreed. But it should be 'cd $TESTTMP'.
>
>> That would also protect against the situation where a directory creation
>> (clone?) and the following 'cd' for some reason fails and the matching
>> 'cd ..' then escapes from TESTDIR and can cause various degrees of damage.
>
> Right.
>
>> Manually spreading 'pwd' everywhere doesn't scale ... and is an
>> unrelated change, FWIW.
>
> The current offenders can be found with
>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -610,6 +610,9 @@
> f = open(test)
> t = f.readlines()
> f.close()
> + t.append(' $ pwd\n')
> + pwd = ' $TESTTMP/* (glob)\n'
> + t.append(pwd)
No. That's wrong as well. Sorry for the noise.
More information about the Mercurial-devel
mailing list