Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix fudging of orelse tests
the ok() call needs to be at the start of the line, otherwise fudge ignores it
  • Loading branch information
moritz committed Apr 12, 2014
1 parent 0003eab commit 13206ce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions S03-operators/orelse.t
Expand Up @@ -13,19 +13,20 @@ my $tracker = 0;
ok (1 orelse ($tracker = 1)), 'sanity';
nok $tracker, 'orelse thunks';

#?rakudo skip 'orelse $! semantics'
#?rakudo skip 'orelse sets $!'
{
try { die "oh noes!" } orelse ok(~$! eq "oh noes!", 'orelse sets $! after an exception');
try { die "oh noes!" } orelse
ok(~$! eq "oh noes!", 'orelse sets $! after an exception');
}

#?rakudo skip 'orelse $! semantics'
#?rakudo skip 'orelse passes $! as argument'
{
try { die "oh noes!" } orelse -> $foo {
ok ~$foo eq "oh noes!", 'orelse passes $! to one argument after an exception';
};
}

#?rakudo skip 'orelse $! semantics'
#?rakudo skip 'orelse passes $! as multiple arguments'
{
try { die "oh noes!" } orelse -> $foo, $bar {
ok ~$foo eq "oh noes!" && ~$bar eq "oh noes!", 'orelse passes $! to two arguments after an exception';
Expand Down

0 comments on commit 13206ce

Please sign in to comment.