Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: using trap function to cleanup and exit?



Bart Schaefer wrote on Thu, 14 Apr 2022 23:35 +00:00:
> On Thu, Apr 14, 2022 at 2:29 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>
>> I've therefore included cleaning up the BUGS file and reversing the
>> sense of that test
>
> I suppose I should also have reversed the sense of the test description.
>
> diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
> index 3bd2958cb..8d1283552 100644
> --- a/Test/C03traps.ztst
> +++ b/Test/C03traps.ztst
> @@ -901,7 +901,7 @@ F:Must be tested with a top-level script rather
> than source or function
>   fn trap1 trap2
>   echo out2
>   '
> --:(workers/44007) function execution continues after 'exit' in trap
> +-:'exit' in trap causes calling function to return

Change «-» to «0» (or whatever exit code is appropriate)?

When a test is XFail ('f' flag), I like to write its expectations as
minimally as possible, in order to make it easy for the test to XPass
("was expected to fail, but passed"); however, once the bug is fixed and
the test starts to pass (= without 'f'), expectations can be tightened.

Not awake enough to review the C changes right now, sorry.

Cheers,

Daniel


>  >out1
>  >fn1
>  >trap1




Messages sorted by: Reverse Date, Date, Thread, Author