Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test to cover declaring symbols in a block making it a hash for sure.

  • Loading branch information...
commit af688d33a029c540ec39a6e4a37750a2bf7cbeef 1 parent f66dad4
@jnthn jnthn authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 S06-other/anon-hashes-vs-blocks.t
View
9 S06-other/anon-hashes-vs-blocks.t
@@ -4,7 +4,7 @@ use Test;
# L<S06/Anonymous hashes vs blocks>
-plan 15;
+plan 17;
my $hash = {
'1' => { '2' => 3, '4' => 5 },
@@ -49,6 +49,13 @@ ok $bar ~~ Hash, '%foo in a block causes hash composing';
ok {;} ~~ Block, '{;} is a Block';
}
+{
+ my @foo = <a b>;
+ my %hash = map { (state $counter)++ => $_ }, @foo;
+ is %hash<0>, 'a', 'state variable declaration certainly makes it a block (1)';
+ is %hash<1>, 'b', 'state variable declaration certainly makes it a block (2)';
+}
+
done;
# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.