Skip to content

Commit

Permalink
Add tests for RT #77504
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Jan 2, 2015
1 parent d3aa62b commit a3669d5
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion S02-types/hash.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 90;
plan 93;

# basic lvalue assignment
# L<S09/Hashes>
Expand Down Expand Up @@ -322,6 +322,21 @@ eval_lives_ok('my $rt75694 = { has-b => 42 }', "can have a bareword key starting
is item(%hash).perl, ({ a => 1 }).perl, 'item(%hash) is equivalent to {%hash}';
}

# RT #77504
{
throws_like { ~[]<c> }, Exception,
message => 'postcircumfix:<{ }> not defined for type Array',
'adequate Failure error message when hash-indexing a non-hash using .<> (1)';

throws_like { ~5<c> }, Exception,
message => 'postcircumfix:<{ }> not defined for type Int',
'adequate Failure error message when hash-indexing a non-hash using .<> (2)';

throws_like { ~5{'c'} }, Exception,
message => 'postcircumfix:<{ }> not defined for type Int',
'adequate Failure error message when hash-indexing a non-hash using .{}';
}

done;

# vim: ft=perl6

0 comments on commit a3669d5

Please sign in to comment.