Test that in "~~ sub", the sub is not called on empty hashes and arrays
Rafael Garcia-Suarez [Tue, 17 Mar 2009 14:11:05 +0000 (15:11 +0100)]
t/op/smartmatch.t

index 7736269..c480e0e 100644 (file)
@@ -220,8 +220,12 @@ __DATA__
 @      undef           \&fatal
 @      1               \&fatal
 @      [1]             \&fatal
+@      {a=>1}          \&fatal
 @      "foo"           \&fatal
 @      qr//            \&fatal
+# sub is not called on empty hashes / arrays
+       []              \&fatal
+       +{}             \&fatal
 
 # - null-prototyped subs
 !      undef           \&FALSE