Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Swap trys for lives_ok
  • Loading branch information
vendethiel committed Apr 5, 2014
1 parent 580f5c1 commit 2274ac4
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions S03-operators/orelse.t
Expand Up @@ -12,38 +12,30 @@ ok (1 orelse ($tracker = 1)), 'sanity';
nok $tracker, 'orelse thunks';

#?rakudo todo "orelse exception semantics"
{
lives_ok {
my $result = 0;
try {
die "oh noes!" orelse $result = 1;
}
die "oh noes!" orelse $result = 1;
ok $result, "orelse continues after an exception";
}

#?rakudo todo "orelse exception semantics"
{
lives_ok {
my $result = 0;
try {
die "oh noes!" orelse $result = ~$! eq "oh noes!";
}
die "oh noes!" orelse $result = ~$! eq "oh noes!";
ok $result, "orelse sets $! after an exception";
}

#?rakudo todo "orelse exception semantics"
{
lives_ok {
my $result = 0;
try {
die "oh noes!" orelse -> $foo { $result = ~$foo eq "oh noes!" };
}
die "oh noes!" orelse -> $foo { $result = ~$foo eq "oh noes!" };
ok $result, "orelse passes $! to one argument after an exception";
}

#?rakudo todo "orelse exception semantics"
{
lives_ok {
my $result = 0;
try {
die "oh noes!" orelse -> $foo, $bar { $result = ~$foo eq "oh noes!" && ~$bar eq "oh noes!" };
}
die "oh noes!" orelse -> $foo, $bar { $result = ~$foo eq "oh noes!" && ~$bar eq "oh noes!" };
ok $result, "orelse passes $! to two arguments after an exception";
}

Expand Down

0 comments on commit 2274ac4

Please sign in to comment.