Skip to content

Commit

Permalink
test for RT #75868, Match objects as Hash keys
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 18, 2010
1 parent 280ebde commit 8c3cfd3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S02-builtin_data_types/hash.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 74;
plan 76;

# basic lvalue assignment
# L<S09/Hashes>
Expand Down Expand Up @@ -250,6 +250,15 @@ lives_ok { Hash.new("a" => "b") }, 'Hash.new($pair) lives';
is %h{*}.join('|'), %h.values.join('|'), '{*} zen slice';
}

# RT #75868
{
my %h = (ab => 'x', 'a' => 'y');
'abc' ~~ /^(.)./;
is %h{$/}, 'x', 'can use $/ as hash key';
is %h{$0}, 'y', 'can use $0 as hash key';

}

done_testing;

# vim: ft=perl6

0 comments on commit 8c3cfd3

Please sign in to comment.