Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix tests for Failure/sink interaction.
A couple of places sunk unhandled Failures, unintentionally. This
corrects them, now that Rakudo does Failure sinking.
  • Loading branch information
jnthn committed Jan 10, 2013
1 parent fa9e6b7 commit d0088f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions S02-types/array.t
Expand Up @@ -225,18 +225,18 @@ my @array2 = ("test", 1, Mu);

{
my @arr;
lives_ok { @arr[*-1] }, "readonly accessing [*-1] of an empty array is ok (1)";
ok !(try { @arr[*-1] }), "readonly accessing [*-1] of an empty array is ok (2)";
ok @arr[*-1] ~~ Failure, "readonly accessing [*-1] of an empty array gives Failure";
ok !(try { @arr[*-1] }), "readonly accessing [*-1] of an empty array does not die";
#?pugs 2 todo
dies_ok { @arr[*-1] = 42 }, "assigning to [*-1] of an empty array is fatal";
dies_ok { @arr[*-1] := 42 }, "binding [*-1] of an empty array is fatal";
}

{
my @arr = (23);
lives_ok { @arr[*-2] }, "readonly accessing [*-2] of an one-elem array is ok (1)";
ok @arr[*-2] ~~ Failure, "readonly accessing [*-2] of an one-elem array gives Failure";
#?pugs 3 todo
ok !(try { @arr[*-2] }), "readonly accessing [*-2] of an one-elem array is ok (2)";
ok !(try { @arr[*-2] }), "readonly accessing [*-2] of an one-elem array does not die";
dies_ok { @arr[*-2] = 42 }, "assigning to [*-2] of an one-elem array is fatal";
dies_ok { @arr[*-2] := 42 }, "binding [*-2] of an empty array is fatal";
}
Expand Down
2 changes: 1 addition & 1 deletion S32-str/numeric.t
Expand Up @@ -16,7 +16,7 @@ sub check($str, $expected_type, $expected_number, $desc?) {
#?DOES 1
sub f($str) {
my $num = 0; # defined
try { $num = +$str }
so try { $num = +$str }
ok !$num.defined, "+$str fails";
}

Expand Down

0 comments on commit d0088f5

Please sign in to comment.