From: Rafael Garcia-Suarez Date: Tue, 17 Feb 2009 07:22:44 +0000 (+0100) Subject: Fix {%hash} ~~ %hash test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fceebc475db7280476c58dcfb36c7e1cd6795eec;p=p5sagit%2Fp5-mst-13.2.git Fix {%hash} ~~ %hash test This was not parsed as a smart match, because {%hash} was taken as a block, not a an anonymous hash. Also, avoid to construct an anonymous hash with an odd number of elements. --- diff --git a/t/op/smartmatch.t b/t/op/smartmatch.t index cf06a44..e2ea004 100644 --- a/t/op/smartmatch.t +++ b/t/op/smartmatch.t @@ -201,7 +201,7 @@ __DATA__ # - a regex {foo => 1} qr/^(fo[ox])$/ -! +{0..100} qr/[13579]$/ +! +{0..99} qr/[13579]$/ # - a string +{foo => 1, bar => 2} "foo" @@ -267,7 +267,7 @@ __DATA__ %hash [qw(bar)] ! %hash [qw(a b c)] %hash %hash - %hash {%hash} + %hash +{%hash} %hash %tied_hash %tied_hash %tied_hash %hash { foo => 5, bar => 10 }