diff options
Diffstat (limited to 't')
-rw-r--r-- | t/op/smartmatch.t | 1 | ||||
-rw-r--r-- | t/op/switch.t | 21 |
2 files changed, 14 insertions, 8 deletions
diff --git a/t/op/smartmatch.t b/t/op/smartmatch.t index 52e7f911e6..0097bff858 100644 --- a/t/op/smartmatch.t +++ b/t/op/smartmatch.t @@ -135,6 +135,7 @@ __DATA__ ! "" undef ! !1 undef undef undef + (my $u) undef # Any ~~ object overloaded # object overloaded ~~ Any diff --git a/t/op/switch.t b/t/op/switch.t index b00ade8cc1..de44082bc7 100644 --- a/t/op/switch.t +++ b/t/op/switch.t @@ -133,14 +133,16 @@ sub check_outside1 { is($_, "outside", "\$_ lexically scoped") } is($ok, 1, "Given(0) when($undef++)"); } { - my $ok = 1; - given (undef) { when(0) {$ok = 0} } + no warnings "uninitialized"; + my $ok = 0; + given (undef) { when(0) {$ok = 1} } is($ok, 1, "Given(undef) when(0)"); } { + no warnings "uninitialized"; my $undef; - my $ok = 1; - given ($undef) { when(0) {$ok = 0} } + my $ok = 0; + given ($undef) { when(0) {$ok = 1} } is($ok, 1, 'Given($undef) when(0)'); } ######## @@ -156,14 +158,16 @@ sub check_outside1 { is($_, "outside", "\$_ lexically scoped") } is($ok, 1, 'Given("") when($undef)'); } { - my $ok = 1; - given (undef) { when("") {$ok = 0} } + no warnings "uninitialized"; + my $ok = 0; + given (undef) { when("") {$ok = 1} } is($ok, 1, 'Given(undef) when("")'); } { + no warnings "uninitialized"; my $undef; - my $ok = 1; - given ($undef) { when("") {$ok = 0} } + my $ok = 0; + given ($undef) { when("") {$ok = 1} } is($ok, 1, 'Given($undef) when("")'); } ######## @@ -617,6 +621,7 @@ my $f = tie my $v, "FetchCounter"; my $ok; $v = undef; is($f->count(), 0, "Sanity check: $test_name"); + no warnings "uninitialized"; given(my $undef) { when(sub{0}->()) {} when("21") {} |