In perl.git, the branch smartmatch has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/289d21b27f6ed6d510e19182f97e90e2203be76c?hp=ae20c3aa7c1b22aa5d270fcda2d83ea1f5e96c46>

- Log -----------------------------------------------------------------
commit 289d21b27f6ed6d510e19182f97e90e2203be76c
Author: Rafael Garcia-Suarez <[email protected]>
Date:   Wed May 13 10:30:07 2009 +0200

    Enable more warnings in smart match tests
-----------------------------------------------------------------------

Summary of changes:
 t/op/smartmatch.t |   16 ++++++++++------
 t/op/switch.t     |    2 --
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/t/op/smartmatch.t b/t/op/smartmatch.t
index ab36cbf..a7a33f7 100644
--- a/t/op/smartmatch.t
+++ b/t/op/smartmatch.t
@@ -6,6 +6,8 @@ BEGIN {
     require './test.pl';
 }
 use strict;
+use warnings;
+no warnings 'uninitialized';
 
 use Tie::Array;
 use Tie::Hash;
@@ -62,7 +64,13 @@ while (<DATA>) {
     my $tstr = "$left ~~ $right";
 
     test_again:
-    my $res = eval $tstr;
+    my $res;
+    if ($note =~ /NOWARNINGS/) {
+       $res = eval "no warnings; $tstr";
+    }
+    else {
+       $res = eval $tstr;
+    }
 
     chomp $@;
 
@@ -322,10 +330,6 @@ __DATA__
 !      $obj            @fooormore
        $obj            [sub{ref shift}]
 
-#  - works with lists instead of arrays
-       "foo"                   qw(foo bar)     TODO
-       "foo"                   ('foo','bar')   TODO
-
 #  - a regex
 =      qr/x/           [qw(foo bar baz quux)]
 =!     qr/y/           [qw(foo bar baz quux)]
@@ -368,7 +372,7 @@ __DATA__
 =      2               "2"
 =      2               "2.0"
 !      2               "2bananas"
-!=     2_3             "2_3"
+!=     2_3             "2_3"           NOWARNINGS
        FALSE           "0"
 
 # Regex against string
diff --git a/t/op/switch.t b/t/op/switch.t
index 79b3797..55ed457 100644
--- a/t/op/switch.t
+++ b/t/op/switch.t
@@ -16,7 +16,6 @@ use Test::More tests => 122;
               
 
 use feature 'switch';
-no warnings "numeric";
 
 eval { continue };
 like($@, qr/^Can't "continue" outside/, "continue outside");
@@ -735,7 +734,6 @@ my $f = tie my $v, "FetchCounter";
 
 # Code references
 {
-    no warnings "redefine";
     my $called_foo = 0;
     sub foo {$called_foo = 1; "@_" eq "foo"}
     my $called_bar = 0;

--
Perl5 Master Repository

Reply via email to