summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-10-13 16:04:18 +0100
committerJesse Vincent <jesse@bestpractical.com>2009-10-16 12:30:17 -0400
commitd1d15184c41c6ad4f16829561163cd118e5ae917 (patch)
tree65d9365479cc68a7c33c3388058bc9654e4a500b /t
parent43b3daf05d64926950dcc26b6a3e77b7c8f513da (diff)
downloadperl-d1d15184c41c6ad4f16829561163cd118e5ae917.tar.gz
Enable deprecation warnings by default.
Diffstat (limited to 't')
-rw-r--r--t/lib/warnings/op28
-rw-r--r--t/lib/warnings/toke20
2 files changed, 20 insertions, 28 deletions
diff --git a/t/lib/warnings/op b/t/lib/warnings/op
index 0891bd8bbb..73f1527fcf 100644
--- a/t/lib/warnings/op
+++ b/t/lib/warnings/op
@@ -106,7 +106,6 @@ EXPECT
Found = in conditional, should be == at - line 3.
########
# op.c
-use warnings 'deprecated';
my (@foo, %foo);
%main::foo->{"bar"};
%foo->{"bar"};
@@ -126,14 +125,14 @@ $foo = {}; %$foo->{"bar"};
$main::foo = []; @$main::foo->[34];
$foo = []; @$foo->[34];
EXPECT
+Using a hash as a reference is deprecated at - line 3.
Using a hash as a reference is deprecated at - line 4.
-Using a hash as a reference is deprecated at - line 5.
+Using an array as a reference is deprecated at - line 5.
Using an array as a reference is deprecated at - line 6.
-Using an array as a reference is deprecated at - line 7.
+Using a hash as a reference is deprecated at - line 7.
Using a hash as a reference is deprecated at - line 8.
-Using a hash as a reference is deprecated at - line 9.
+Using an array as a reference is deprecated at - line 9.
Using an array as a reference is deprecated at - line 10.
-Using an array as a reference is deprecated at - line 11.
########
# op.c
use warnings 'void' ; close STDIN ;
@@ -727,20 +726,18 @@ EXPECT
Format FRED redefined at - line 5.
########
# op.c
-use warnings 'deprecated' ;
push FRED;
no warnings 'deprecated' ;
push FRED;
EXPECT
-Array @FRED missing the @ in argument 1 of push() at - line 3.
+Array @FRED missing the @ in argument 1 of push() at - line 2.
########
# op.c
-use warnings 'deprecated' ;
@a = keys FRED ;
no warnings 'deprecated' ;
@a = keys FRED ;
EXPECT
-Hash %FRED missing the % in argument 1 of keys() at - line 3.
+Hash %FRED missing the % in argument 1 of keys() at - line 2.
########
# op.c
use warnings 'syntax' ;
@@ -751,24 +748,21 @@ Statement unlikely to be reached at - line 4.
(Maybe you meant system() when you said exec()?)
########
# op.c
-use warnings 'deprecated' ;
my @a; defined(@a);
EXPECT
-defined(@array) is deprecated at - line 3.
+defined(@array) is deprecated at - line 2.
(Maybe you should just omit the defined()?)
########
# op.c
-use warnings 'deprecated' ;
defined(@a = (1,2,3));
EXPECT
-defined(@array) is deprecated at - line 3.
+defined(@array) is deprecated at - line 2.
(Maybe you should just omit the defined()?)
########
# op.c
-use warnings 'deprecated' ;
my %h; defined(%h);
EXPECT
-defined(%hash) is deprecated at - line 3.
+defined(%hash) is deprecated at - line 2.
(Maybe you should just omit the defined()?)
########
# op.c
@@ -1031,7 +1025,6 @@ Useless localization of match position at - line 49.
Useless localization of vec at - line 50.
########
# op.c
-use warnings 'deprecated';
my $x1 if 0;
my @x2 if 0;
my %x3 if 0;
@@ -1047,13 +1040,13 @@ if (my $w2) { $a=1 }
if ($a && (my $w3 = 1)) {$a = 2}
EXPECT
+Deprecated use of my() in false conditional at - line 2.
Deprecated use of my() in false conditional at - line 3.
Deprecated use of my() in false conditional at - line 4.
Deprecated use of my() in false conditional at - line 5.
Deprecated use of my() in false conditional at - line 6.
Deprecated use of my() in false conditional at - line 7.
Deprecated use of my() in false conditional at - line 8.
-Deprecated use of my() in false conditional at - line 9.
########
# op.c
$[ = 1;
@@ -1062,4 +1055,5 @@ $[ = 2;
no warnings 'deprecated';
$[ = 3;
EXPECT
+Use of assignment to $[ is deprecated at - line 2.
Use of assignment to $[ is deprecated at - line 4.
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke
index e5ca40002e..a7ef0f8973 100644
--- a/t/lib/warnings/toke
+++ b/t/lib/warnings/toke
@@ -125,7 +125,6 @@ toke.c AOK
__END__
# toke.c
-use warnings 'deprecated' ;
format STDOUT =
@<<< @||| @>>> @>>>
$a $b "abc" 'def'
@@ -136,19 +135,18 @@ format STDOUT =
$a $b "abc" 'def'
.
EXPECT
-Use of comma-less variable list is deprecated at - line 5.
-Use of comma-less variable list is deprecated at - line 5.
-Use of comma-less variable list is deprecated at - line 5.
+Use of comma-less variable list is deprecated at - line 4.
+Use of comma-less variable list is deprecated at - line 4.
+Use of comma-less variable list is deprecated at - line 4.
########
# toke.c
-use warnings 'deprecated' ;
$a = <<;
no warnings 'deprecated' ;
$a = <<;
EXPECT
-Use of bare << to mean <<"" is deprecated at - line 3.
+Use of bare << to mean <<"" is deprecated at - line 2.
########
# toke.c
use warnings 'syntax' ;
@@ -853,7 +851,7 @@ sub glipp :locked {
}
sub whack_eth ($) : locked {
}
-use warnings 'deprecated';
+no warnings 'deprecated';
our $bar :unique;
sub zapeth :locked;
sub ker_plop :locked {
@@ -861,10 +859,10 @@ sub ker_plop :locked {
sub swa_a_p ($) : locked {
}
EXPECT
-Use of :unique is deprecated at - line 9.
-Use of :locked is deprecated at - line 10.
-Use of :locked is deprecated at - line 11.
-Use of :locked is deprecated at - line 13.
+Use of :unique is deprecated at - line 2.
+Use of :locked is deprecated at - line 3.
+Use of :locked is deprecated at - line 4.
+Use of :locked is deprecated at - line 6.
########
# toke.c
use warnings "syntax";