Skip to content
Browse files

[t] merge hash_sub.t into spec/

git-svn-id: http://svn.pugscode.org/pugs@27420 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent a6b0bef commit 4502acb5c8185cd101be5623975eaa1626b01f22 moritz committed Jul 5, 2009
Showing with 15 additions and 1 deletion.
  1. +15 −1 S06-other/anon-hashes-vs-blocks.t
View
16 S06-other/anon-hashes-vs-blocks.t
@@ -22,7 +22,7 @@ L<S06/Anonymous hashes vs blocks>
=end pod
-plan 5;
+plan 8;
my $hash = {
'1' => { '2' => 3, '4' => 5 },
@@ -43,3 +43,17 @@ my $bar = { %foo };
#?rakudo todo 'block parsing'
ok $bar ~~ Hash, '%foo in a block causes hash composing';
+
+# pugs had problems with //= and the hash() contextualizer
+{
+ my %hash;
+ %hash<foo> //= hash();
+ %hash<bar> //= hash;
+ my $h_ref;
+ $h_ref //= hash();
+ is(%hash<foo>.WHAT, ::Hash, "Parses as two items");
+ is(%hash<bar>.WHAT, ::Hash, "Parens do not help");
+ is($h_ref.WHAT, ::Hash, "It is not limited to hash values");
+}
+
+# vim: ft=perl6

0 comments on commit 4502acb

Please sign in to comment.
Something went wrong with that request. Please try again.