Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/tests/util/sh



In article <20100603164416.GD6237%apb-laptoy.apb.alt.za@localhost>,
Alan Barrett  <apb%cequrux.com@localhost> wrote:
>On Thu, 03 Jun 2010, Christos Zoulas wrote:
>> Log Message:
>> Pass all the set -e tests.
>> 
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.6 -r1.7 src/tests/util/sh/t_set_e.sh
>
>Now the tests don't match the comments.
>
>>      # according to the standard, only failing *simple* commands
>>      # cause an exit under -e. () is not a simple command.
>> -    dcheck '(set -e; (set +e; false; echo OK; false); echo OK)' 'OK OK'
>> -    echeck '(set -e; (set +e; false; echo OK; false); echo OK)' 'OK OK'
>> +    dcheck '(set -e; (set +e; false; echo OK; false); echo OK)' 'OK'
>> +    echeck '(set -e; (set +e; false; echo OK; false); echo OK)' 'OK'
>
>The comment explains that failure of the inner subshell should not cause
>the outer subshell to exit.  This means that both the inner and outer
>"echo OK" should be performed; but the test expects only the inner "echo
>OK" to be performed.  Similarly for the other changed tests.

Well, I was not sure what to do there [fix the comments, or remove the
tests]. Bash and ksh behave the same way as ours does, so I am inclined
to believe that the standard is mis-worded or mis-interpreted.

christos



Home | Main Index | Thread Index | Old Index