develooper Front page | perl.perl6.users | Postings from October 2018

Re: Testing Was: Appropriate last words

Thread Previous
From:
Timo Paulssen
Date:
October 21, 2018 08:37
Subject:
Re: Testing Was: Appropriate last words
Message ID:
66717a09-fcb7-f0e8-1bd1-aa0c6649af3a@wakelift.de
I think you would just have something like this in your test program's
mainline:

    my &*EXIT = -> | { die "exit was called" }

and then you can use dies-ok. Bonus points for creating your own
exception class so that you can check that it was actually &*EXIT that
got you there, and not some random exception like "file not found".

On 21/10/2018 10:32, Richard Hainsworth wrote:
> How does this answer the question about testing?
>
> Ok so there is code, but where do I go to find what that code is?
> Where in the Rakudo repo would I start looking, eg.?
>
>
> On 21/10/18 16:23, Timo Paulssen wrote:
>> https://docs.perl6.org/language/variables#index-entry-%24%2AEXIT
>>
>> this should help you get to where you want to be.
>>
>> Someone™ can feel free to open up a ticket on the doc repository that
>> the routine page for exit doesn't have a link to or explanation of
>> &*EXIT.
>>
>> HTH
>>    - Timo

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About