-
-
Save zengargoyle/5ba20a3c5799327b44d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test; | |
my $i = (1,2,3); | |
my %h{Any}; | |
%h{$i} = 'foo'; | |
is %h{$i}:exists, True, 'key exists'; | |
is %h.EXISTS-KEY($i), True, 'this works'; | |
# maybe rest is not bug but wrong usage causing BOOM | |
# | |
my %s; | |
my $x = 'hello'; | |
%s<<$x>> = 'foo'; | |
is %s<<hello>>, 'foo', 'got foo <<no-var>>'; | |
is %s<<$x>>, 'foo', 'got foo <<$var>>'; | |
is %s{"$x"}, 'foo', 'got foo {"$var"}'; | |
%s{"$i"} = 'bar'; | |
# is $s<<$i>>, 'bar', 'blows up ugly'; | |
is %s{"$i"}, 'bar', 'works with {"$i"}'; | |
done-testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ perl6 bug-hash.p6 | |
not ok 1 - key exists | |
# Failed test 'key exists' | |
# at bug-hash.p6 line 8 | |
# expected: 'True' | |
# got: 'False False False' | |
ok 2 - this works | |
ok 3 - got foo <<no-var>> | |
ok 4 - got foo <<$var>> | |
ok 5 - got foo {"$var"} | |
ok 6 - works with {"$i"} | |
1..6 | |
# Looks like you failed 1 test of 6 | |
$ perl6 --version | |
This is perl6 version 2015.10-16-g2f4bfd8 built on MoarVM version 2015.10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment