From: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
Date: Wed, 13 May 2009 08:30:07 +0000 (+0200)
Subject: Enable more warnings in smart match tests
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=289d21b27f6ed6d510e19182f97e90e2203be76c;p=p5sagit%2Fp5-mst-13.2.git

Enable more warnings in smart match tests
---

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;