diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-12-07 13:41:05 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-12-07 13:41:05 +0100 |
commit | 69c3dccf5322a59cb855347c04712ba11b65328f (patch) | |
tree | 6e844945249bc28fdbb94058aae7b541aa493cd4 /t/op/switch.t | |
parent | 289281205c65de071383bf72b5d8aef3c17f427b (diff) | |
download | perl-69c3dccf5322a59cb855347c04712ba11b65328f.tar.gz |
Fix [perl #71078] Smart match against @_ gives false negatives
@_ can contain NULLs for undefined elements
Diffstat (limited to 't/op/switch.t')
-rw-r--r-- | t/op/switch.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/switch.t b/t/op/switch.t index 80d6b985f1..92faceffa8 100644 --- a/t/op/switch.t +++ b/t/op/switch.t @@ -9,7 +9,7 @@ BEGIN { use strict; use warnings; -plan tests => 128; +plan tests => 132; # The behaviour of the feature pragma should be tested by lib/switch.t # using the tests in t/lib/switch/*. This file tests the behaviour of @@ -1024,6 +1024,13 @@ GIVEN5: is($flag, 1, "goto inside given and when to the given stmt"); } +# test with unreified @_ in smart match [perl #71078] +sub unreified_check { ok([@_] ~~ \@_) } # should always match +unreified_check(1,2,"lala"); +unreified_check(1,2,undef); +unreified_check(undef); +unreified_check(undef,""); + # Okay, that'll do for now. The intricacies of the smartmatch # semantics are tested in t/op/smartmatch.t __END__ |