summaryrefslogtreecommitdiff
path: root/t/op/smartmatch.t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-03-23 15:45:55 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-03-23 15:46:08 +0100
commit2a37c5e7310aa2e0852ae3dcc39c0d69b41babe6 (patch)
tree43df81c01f2fed0e88120a9d5c88ba99aebc7827 /t/op/smartmatch.t
parent61a621c635b84b53e4eb7d27f7e28c7cd3bdf7e6 (diff)
downloadperl-2a37c5e7310aa2e0852ae3dcc39c0d69b41babe6.tar.gz
Add more tests with an empty hash on the right of ~~
Diffstat (limited to 't/op/smartmatch.t')
-rw-r--r--t/op/smartmatch.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/op/smartmatch.t b/t/op/smartmatch.t
index a8b387bf21..d336cfc44d 100644
--- a/t/op/smartmatch.t
+++ b/t/op/smartmatch.t
@@ -232,7 +232,7 @@ __DATA__
# HASH ref against:
# - another hash ref
{} {}
-! {} {1 => 2}
+=! {} {1 => 2}
{1 => 2} {1 => 2}
{1 => 2} {1 => 3}
! {1 => 2} {2 => 3}
@@ -245,7 +245,10 @@ __DATA__
# - an array ref
[keys %main::] \%::
! [] \%::
+! [""] {}
+! [] {}
[undef] {"" => 1}
+ [""] {"" => 1}
["foo"] { foo => 1 }
["foo", "bar"] { foo => 1 }
["foo", "bar"] \%hash
@@ -256,6 +259,8 @@ __DATA__
# - a regex
qr/^(fo[ox])$/ {foo => 1}
! qr/[13579]$/ +{0..99}
+! qr/a*/ {}
+ qr/a*/ {b=>2}
# - a string
"foo" +{foo => 1, bar => 2}
@@ -264,6 +269,7 @@ __DATA__
# - undef
! undef %hash
! undef +{"" => "empty key"}
+! undef {}
# ARRAY ref against:
# - another array ref