Move tests for ‘used once’ from util to gv
authorFather Chrysostomos <sprout@cpan.org>
Mon, 4 Nov 2013 13:51:50 +0000 (05:51 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 5 Nov 2013 04:26:04 +0000 (20:26 -0800)
The warning itself is triggered in gv.c, so this makes the tests
easier to find.

t/lib/warnings/gv
t/lib/warnings/util

index 6b022e1..67ee1d4 100644 (file)
@@ -14,6 +14,8 @@
        $a = ${"#"} ;
        $a = ${"*"} ;
 
+     Name "main::a" used only once: possible typo
+
   Mandatory Warnings ALL TODO
   ------------------
 
@@ -121,3 +123,173 @@ package Y;
 EXPECT
 Can't locate package Fred for @Y::ISA at - line 6.
 Undefined subroutine &Y::joe called at - line 6.
+########
+# gv.c
+use warnings;
+$x = 1;
+if ($x) {
+    print $y;
+}
+EXPECT
+Name "main::y" used only once: possible typo at - line 5.
+Use of uninitialized value $y in print at - line 5.
+########
+# gv.c
+use warnings;
+$x = 1;
+if ($x) {
+    $x++;
+    print $y;
+}
+EXPECT
+Name "main::y" used only once: possible typo at - line 6.
+Use of uninitialized value $y in print at - line 6.
+########
+# gv.c
+use warnings;
+$x = 0;
+if ($x) {
+    print "1\n";
+} elsif (!$x) {
+    print $y;
+} else {
+    print "0\n";
+}
+EXPECT
+Name "main::y" used only once: possible typo at - line 7.
+Use of uninitialized value $y in print at - line 7.
+########
+# gv.c
+use warnings;
+$x = 0;
+if ($x) {
+    print "1\n";
+} elsif (!$x) {
+    $x++;
+    print $y;
+} else {
+    print "0\n";
+}
+EXPECT
+Name "main::y" used only once: possible typo at - line 8.
+Use of uninitialized value $y in print at - line 8.
+########
+# gv.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings;
+$ㄒ = 1;
+if ($ㄒ) {
+    print $ʎ;
+}
+EXPECT
+Name "main::ʎ" used only once: possible typo at - line 7.
+Use of uninitialized value $ʎ in print at - line 7.
+########
+# gv.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings;
+$ㄒ = 1;
+if ($ㄒ) {
+    $ㄒ++;
+    print $ʎ;
+}
+EXPECT
+Name "main::ʎ" used only once: possible typo at - line 8.
+Use of uninitialized value $ʎ in print at - line 8.
+########
+# gv.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings;
+$ㄒ = 0;
+if ($ㄒ) {
+    print "1\n";
+} elsif (!$ㄒ) {
+    print $ʎ;
+} else {
+    print "0\n";
+}
+EXPECT
+Name "main::ʎ" used only once: possible typo at - line 9.
+Use of uninitialized value $ʎ in print at - line 9.
+########
+# gv.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings;
+$ㄒ = 0;
+if ($ㄒ) {
+    print "1\n";
+} elsif (!$ㄒ) {
+    $ㄒ++;
+    print $ʎ;
+} else {
+    print "0\n";
+}
+EXPECT
+Name "main::ʎ" used only once: possible typo at - line 10.
+Use of uninitialized value $ʎ in print at - line 10.
+########
+# gv.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings;
+package 팣칵ぇ;
+$ㄒ = 1;
+if ($ㄒ) {
+    print $ʎ;
+}
+EXPECT
+Name "팣칵ぇ::ʎ" used only once: possible typo at - line 8.
+Use of uninitialized value $팣칵ぇ::ʎ in print at - line 8.
+########
+# gv.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings;
+package 팣칵ぇ;
+$ㄒ = 1;
+if ($ㄒ) {
+    $ㄒ++;
+    print $ʎ;
+}
+EXPECT
+Name "팣칵ぇ::ʎ" used only once: possible typo at - line 9.
+Use of uninitialized value $팣칵ぇ::ʎ in print at - line 9.
+########
+# gv.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings;
+package 팣칵ぇ;
+$ㄒ = 0;
+if ($ㄒ) {
+    print "1\n";
+} elsif (!$ㄒ) {
+    print $ʎ;
+} else {
+    print "0\n";
+}
+EXPECT
+Name "팣칵ぇ::ʎ" used only once: possible typo at - line 10.
+Use of uninitialized value $팣칵ぇ::ʎ in print at - line 10.
+########
+# gv.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings;
+package 팣칵ぇ;
+$ㄒ = 0;
+if ($ㄒ) {
+    print "1\n";
+} elsif (!$ㄒ) {
+    $ㄒ++;
+    print $ʎ;
+} else {
+    print "0\n";
+}
+EXPECT
+Name "팣칵ぇ::ʎ" used only once: possible typo at - line 11.
+Use of uninitialized value $팣칵ぇ::ʎ in print at - line 11.
index 618cf75..e82d6a6 100644 (file)
@@ -106,173 +106,3 @@ no warnings 'portable' ;
    $a =  oct "0047777777777" ;
 EXPECT
 Octal number > 037777777777 non-portable at - line 5.
-########
-# util.c
-use warnings;
-$x = 1;
-if ($x) {
-    print $y;
-}
-EXPECT
-Name "main::y" used only once: possible typo at - line 5.
-Use of uninitialized value $y in print at - line 5.
-########
-# util.c
-use warnings;
-$x = 1;
-if ($x) {
-    $x++;
-    print $y;
-}
-EXPECT
-Name "main::y" used only once: possible typo at - line 6.
-Use of uninitialized value $y in print at - line 6.
-########
-# util.c
-use warnings;
-$x = 0;
-if ($x) {
-    print "1\n";
-} elsif (!$x) {
-    print $y;
-} else {
-    print "0\n";
-}
-EXPECT
-Name "main::y" used only once: possible typo at - line 7.
-Use of uninitialized value $y in print at - line 7.
-########
-# util.c
-use warnings;
-$x = 0;
-if ($x) {
-    print "1\n";
-} elsif (!$x) {
-    $x++;
-    print $y;
-} else {
-    print "0\n";
-}
-EXPECT
-Name "main::y" used only once: possible typo at - line 8.
-Use of uninitialized value $y in print at - line 8.
-########
-# util.c
-use utf8;
-use open qw( :utf8 :std );
-use warnings;
-$ㄒ = 1;
-if ($ㄒ) {
-    print $ʎ;
-}
-EXPECT
-Name "main::ʎ" used only once: possible typo at - line 7.
-Use of uninitialized value $ʎ in print at - line 7.
-########
-# util.c
-use utf8;
-use open qw( :utf8 :std );
-use warnings;
-$ㄒ = 1;
-if ($ㄒ) {
-    $ㄒ++;
-    print $ʎ;
-}
-EXPECT
-Name "main::ʎ" used only once: possible typo at - line 8.
-Use of uninitialized value $ʎ in print at - line 8.
-########
-# util.c
-use utf8;
-use open qw( :utf8 :std );
-use warnings;
-$ㄒ = 0;
-if ($ㄒ) {
-    print "1\n";
-} elsif (!$ㄒ) {
-    print $ʎ;
-} else {
-    print "0\n";
-}
-EXPECT
-Name "main::ʎ" used only once: possible typo at - line 9.
-Use of uninitialized value $ʎ in print at - line 9.
-########
-# util.c
-use utf8;
-use open qw( :utf8 :std );
-use warnings;
-$ㄒ = 0;
-if ($ㄒ) {
-    print "1\n";
-} elsif (!$ㄒ) {
-    $ㄒ++;
-    print $ʎ;
-} else {
-    print "0\n";
-}
-EXPECT
-Name "main::ʎ" used only once: possible typo at - line 10.
-Use of uninitialized value $ʎ in print at - line 10.
-########
-# util.c
-use utf8;
-use open qw( :utf8 :std );
-use warnings;
-package 팣칵ぇ;
-$ㄒ = 1;
-if ($ㄒ) {
-    print $ʎ;
-}
-EXPECT
-Name "팣칵ぇ::ʎ" used only once: possible typo at - line 8.
-Use of uninitialized value $팣칵ぇ::ʎ in print at - line 8.
-########
-# util.c
-use utf8;
-use open qw( :utf8 :std );
-use warnings;
-package 팣칵ぇ;
-$ㄒ = 1;
-if ($ㄒ) {
-    $ㄒ++;
-    print $ʎ;
-}
-EXPECT
-Name "팣칵ぇ::ʎ" used only once: possible typo at - line 9.
-Use of uninitialized value $팣칵ぇ::ʎ in print at - line 9.
-########
-# util.c
-use utf8;
-use open qw( :utf8 :std );
-use warnings;
-package 팣칵ぇ;
-$ㄒ = 0;
-if ($ㄒ) {
-    print "1\n";
-} elsif (!$ㄒ) {
-    print $ʎ;
-} else {
-    print "0\n";
-}
-EXPECT
-Name "팣칵ぇ::ʎ" used only once: possible typo at - line 10.
-Use of uninitialized value $팣칵ぇ::ʎ in print at - line 10.
-########
-# util.c
-use utf8;
-use open qw( :utf8 :std );
-use warnings;
-package 팣칵ぇ;
-$ㄒ = 0;
-if ($ㄒ) {
-    print "1\n";
-} elsif (!$ㄒ) {
-    $ㄒ++;
-    print $ʎ;
-} else {
-    print "0\n";
-}
-EXPECT
-Name "팣칵ぇ::ʎ" used only once: possible typo at - line 11.
-Use of uninitialized value $팣칵ぇ::ʎ in print at - line 11.