Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make tests for not-throwing on my @A; @A[*-1] more explicit
  • Loading branch information
moritz committed Jan 24, 2015
1 parent 3a2be84 commit 5ddd66b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions S02-types/array.t
Expand Up @@ -222,9 +222,12 @@ my @array2 = ("test", 1, Mu);

{
my @arr;
ok !(try { @arr[*-1] }), "readonly accessing [*-1] of an empty array is not fatal";
# test that @arr[+-1] produces a Failure, which is thrown when a method
# other than .defined is called on it.
lives_ok { @arr[*-1].defined }, "readonly accessing [*-1] of an empty array is not fatal";

# RT #111924
throws_like { @arr[*-1] },
throws_like { @arr[*-1].flurb },
X::OutOfRange,
"readonly accessing [*-1] of an empty array throws X::OutOfRange";
throws_like { @arr[*-1] = 42 },
Expand Down

0 comments on commit 5ddd66b

Please sign in to comment.