Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add bail-out to Test.pm6
Aborts the test run using the Bail out! feature of the TAP protocol.
Exit code set to 255 to mirror Perl 5's BAIL_OUT behaviour, which
I assume is sane.

References:
https://testanything.org/tap-specification.html#bail-out
https://metacpan.org/pod/Test::More#BAIL_OUT
  • Loading branch information
zoffixznet committed Jul 19, 2016
1 parent 8cfd343 commit 58dc8c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Test.pm6
Expand Up @@ -221,6 +221,12 @@ multi sub cmp-ok(Mu $got, $op, Mu $expected, $desc = '') is export {
$ok;
}

sub bail-out ($desc?) is export {
$output.put: join ' ', 'Bail out!', ($desc if $desc);
$done_testing_has_been_run = 1;
exit 255;
}

multi sub is_approx(Mu $got, Mu $expected, $desc = '') is export {
DEPRECATED('is-approx'); # Remove at 20161217 release (6 months from today)

Expand Down

0 comments on commit 58dc8c6

Please sign in to comment.