Make C<undef ~~ 0> and C<undef ~~ ""> not match (like in 5.10.0)
[p5sagit/p5-mst-13.2.git] / t / op / switch.t
index 55ed457..2012c6c 100644 (file)
@@ -3,17 +3,17 @@
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
+    require './test.pl';
 }
 
 use strict;
 use warnings;
 
-use Test::More tests => 122;
+plan tests => 122;
 
 # 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
 # the switch ops themselves.
-              
 
 use feature 'switch';
 
@@ -133,15 +133,15 @@ sub check_outside1 { is($_, "outside", "\$_ lexically scoped") }
 }
 {
     no warnings "uninitialized";
-    my $ok = 0;
-    given (undef) { when(0) {$ok = 1} }
+    my $ok = 1;
+    given (undef) { when(0) {$ok = 0} }
     is($ok, 1, "Given(undef) when(0)");
 }
 {
     no warnings "uninitialized";
     my $undef;
-    my $ok = 0;
-    given ($undef) { when(0) {$ok = 1} }
+    my $ok = 1;
+    given ($undef) { when(0) {$ok = 0} }
     is($ok, 1, 'Given($undef) when(0)');
 }
 ########
@@ -158,15 +158,15 @@ sub check_outside1 { is($_, "outside", "\$_ lexically scoped") }
 }
 {
     no warnings "uninitialized";
-    my $ok = 0;
-    given (undef) { when("") {$ok = 1} }
+    my $ok = 1;
+    given (undef) { when("") {$ok = 0} }
     is($ok, 1, 'Given(undef) when("")');
 }
 {
     no warnings "uninitialized";
     my $undef;
-    my $ok = 0;
-    given ($undef) { when("") {$ok = 1} }
+    my $ok = 1;
+    given ($undef) { when("") {$ok = 0} }
     is($ok, 1, 'Given($undef) when("")');
 }
 ########
@@ -816,8 +816,8 @@ SKIP: {
            default {$matched = 0}
        }
     
-       is($obj->{called}, 0, "$test: called");
-       ok(!$matched, "$test: not matched");
+       is($obj->{called}, 1, "$test: called");
+       ok($matched, "$test: matched");
     }
 
     {
@@ -828,7 +828,7 @@ SKIP: {
            when ("other arg") {$matched = 1}
        }
     
-       is($obj->{called}, 0, "$test: called");
+       is($obj->{called}, 1, "$test: called");
        ok(!$matched, "$test: not matched");
     }