summaryrefslogtreecommitdiff
path: root/t/pragma/warn
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-07-28 04:15:39 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-07-28 04:15:39 +0000
commita4f5cc89eed636ba46185bdb30ee0a36fa506dd8 (patch)
treef5977e607da466cf54c03d09211b9261740610fa /t/pragma/warn
parent0c9177abdae6e91f4dfdab2ef3cc817ec901e51e (diff)
downloadperl-a4f5cc89eed636ba46185bdb30ee0a36fa506dd8.tar.gz
Back out #6454, doesn't seem to work.
(Reason: that patch was for perl 5.6.0, not perl-current) (A version of the patch for perl-current came in later as #6466) p4raw-id: //depot/perl@6458
Diffstat (limited to 't/pragma/warn')
-rw-r--r--t/pragma/warn/2use42
-rw-r--r--t/pragma/warn/4lint40
-rw-r--r--t/pragma/warn/5nolint20
-rw-r--r--t/pragma/warn/7fatal78
-rw-r--r--t/pragma/warn/8signal16
-rw-r--r--t/pragma/warn/toke27
6 files changed, 125 insertions, 98 deletions
diff --git a/t/pragma/warn/2use b/t/pragma/warn/2use
index 3a9c572439..b489d62e19 100644
--- a/t/pragma/warn/2use
+++ b/t/pragma/warn/2use
@@ -13,25 +13,25 @@ BEGIN failed--compilation aborted at - line 3.
########
# Check compile time scope of pragma
-use warnings 'syntax' ;
+use warnings 'deprecated' ;
{
no warnings ;
- my $a =+ 1 ;
+ 1 if $a EQ $b ;
}
-my $a =+ 1 ;
+1 if $a EQ $b ;
EXPECT
-Reversed += operator at - line 8.
+Use of EQ is deprecated at - line 8.
########
# Check compile time scope of pragma
no warnings;
{
- use warnings 'syntax' ;
- my $a =+ 1 ;
+ use warnings 'deprecated' ;
+ 1 if $a EQ $b ;
}
-my $a =+ 1 ;
+1 if $a EQ $b ;
EXPECT
-Reversed += operator at - line 6.
+Use of EQ is deprecated at - line 6.
########
# Check runtime scope of pragma
@@ -67,55 +67,55 @@ EXPECT
Use of uninitialized value in scalar chop at - line 6.
########
-use warnings 'syntax' ;
-my $a =+ 1 ;
+use warnings 'deprecated' ;
+1 if $a EQ $b ;
EXPECT
-Reversed += operator at - line 3.
+Use of EQ is deprecated at - line 3.
########
--FILE-- abc
-my $a =+ 1 ;
+1 if $a EQ $b ;
1;
--FILE--
-use warnings 'syntax' ;
+use warnings 'deprecated' ;
require "./abc";
EXPECT
########
--FILE-- abc
-use warnings 'syntax' ;
+use warnings 'deprecated' ;
1;
--FILE--
require "./abc";
-my $a =+ 1 ;
+1 if $a EQ $b ;
EXPECT
########
--FILE-- abc
-use warnings 'syntax' ;
-my $a =+ 1 ;
+use warnings 'deprecated' ;
+1 if $a EQ $b ;
1;
--FILE--
use warnings 'uninitialized' ;
require "./abc";
my $a ; chop $a ;
EXPECT
-Reversed += operator at ./abc line 2.
+Use of EQ is deprecated at ./abc line 2.
Use of uninitialized value in scalar chop at - line 3.
########
--FILE-- abc.pm
-use warnings 'syntax' ;
-my $a =+ 1 ;
+use warnings 'deprecated' ;
+1 if $a EQ $b ;
1;
--FILE--
use warnings 'uninitialized' ;
use abc;
my $a ; chop $a ;
EXPECT
-Reversed += operator at abc.pm line 2.
+Use of EQ is deprecated at abc.pm line 2.
Use of uninitialized value in scalar chop at - line 3.
########
diff --git a/t/pragma/warn/4lint b/t/pragma/warn/4lint
index 241383c26c..56e3fabe2c 100644
--- a/t/pragma/warn/4lint
+++ b/t/pragma/warn/4lint
@@ -4,11 +4,11 @@ __END__
-W
# lint: check compile time $^W is zapped
BEGIN { $^W = 0 ;}
-$a = 1 ;
-$a =+ 1 ;
+$a = $b = 1 ;
+$a = 1 if $a EQ $b ;
close STDIN ; print STDIN "abc" ;
EXPECT
-Reversed += operator at - line 5.
+Use of EQ is deprecated at - line 5.
print() on closed filehandle main::STDIN at - line 6.
########
-W
@@ -30,11 +30,11 @@ print() on closed filehandle main::STDIN at - line 5.
-W
# lint: check "no warnings" is zapped
no warnings ;
-$a = 1 ;
-$a =+ 1 ;
+$a = $b = 1 ;
+$a = 1 if $a EQ $b ;
close STDIN ; print STDIN "abc" ;
EXPECT
-Reversed += operator at - line 5.
+Use of EQ is deprecated at - line 5.
print() on closed filehandle main::STDIN at - line 6.
########
-W
@@ -57,58 +57,58 @@ print() on closed filehandle main::STDIN at - line 5.
########
-W
--FILE-- abc.pm
-no warnings 'syntax' ;
-my $a = 0;
-$a =+ 1 ;
+no warnings 'deprecated' ;
+my ($a, $b) = (0,0);
+1 if $a EQ $b ;
1;
--FILE--
no warnings 'uninitialized' ;
use abc;
my $a ; chop $a ;
EXPECT
-Reversed += operator at abc.pm line 3.
+Use of EQ is deprecated at abc.pm line 3.
Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc
-no warnings 'syntax' ;
-my $a = 0;
-$a =+ 1 ;
+no warnings 'deprecated' ;
+my ($a, $b) = (0,0);
+1 if $a EQ $b ;
1;
--FILE--
no warnings 'uninitialized' ;
require "./abc";
my $a ; chop $a ;
EXPECT
-Reversed += operator at ./abc line 3.
+Use of EQ is deprecated at ./abc line 3.
Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc.pm
BEGIN {$^W = 0}
-my $a = 0 ;
-$a =+ 1 ;
+my ($a, $b) = (0,0);
+1 if $a EQ $b ;
1;
--FILE--
$^W = 0 ;
use abc;
my $a ; chop $a ;
EXPECT
-Reversed += operator at abc.pm line 3.
+Use of EQ is deprecated at abc.pm line 3.
Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc
BEGIN {$^W = 0}
-my $a = 0 ;
-$a =+ 1 ;
+my ($a, $b) = (0,0);
+1 if $a EQ $b ;
1;
--FILE--
$^W = 0 ;
require "./abc";
my $a ; chop $a ;
EXPECT
-Reversed += operator at ./abc line 3.
+Use of EQ is deprecated at ./abc line 3.
Use of uninitialized value in scalar chop at - line 3.
########
-W
diff --git a/t/pragma/warn/5nolint b/t/pragma/warn/5nolint
index 0eec5df1b4..2459968003 100644
--- a/t/pragma/warn/5nolint
+++ b/t/pragma/warn/5nolint
@@ -5,7 +5,7 @@ __END__
# nolint: check compile time $^W is zapped
BEGIN { $^W = 1 ;}
$a = $b = 1 ;
-$a =+ 1 ;
+$a = 1 if $a EQ $b ;
close STDIN ; print STDIN "abc" ;
EXPECT
########
@@ -27,7 +27,7 @@ EXPECT
# nolint: check "no warnings" is zapped
use warnings ;
$a = $b = 1 ;
-$a =+ 1 ;
+$a = 1 if $a EQ $b ;
close STDIN ; print STDIN "abc" ;
EXPECT
########
@@ -49,9 +49,9 @@ EXPECT
########
-X
--FILE-- abc.pm
-use warnings 'syntax' ;
-my $a = 0;
-$a =+ 1 ;
+use warnings 'deprecated' ;
+my ($a, $b) = (0,0);
+1 if $a EQ $b ;
1;
--FILE--
use warnings 'uninitialized' ;
@@ -61,9 +61,9 @@ EXPECT
########
-X
--FILE-- abc
-use warnings 'syntax' ;
-my $a = 0;
-$a =+ 1 ;
+use warnings 'deprecated' ;
+my ($a, $b) = (0,0);
+1 if $a EQ $b ;
1;
--FILE--
use warnings 'uninitialized' ;
@@ -75,7 +75,7 @@ EXPECT
--FILE-- abc.pm
BEGIN {$^W = 1}
my ($a, $b) = (0,0);
-$a =+ 1 ;
+1 if $a EQ $b ;
1;
--FILE--
$^W = 1 ;
@@ -87,7 +87,7 @@ EXPECT
--FILE-- abc
BEGIN {$^W = 1}
my ($a, $b) = (0,0);
-$a =+ 1 ;
+1 if $a EQ $b ;
1;
--FILE--
$^W = 1 ;
diff --git a/t/pragma/warn/7fatal b/t/pragma/warn/7fatal
index 798fa0059c..2d29ddbd82 100644
--- a/t/pragma/warn/7fatal
+++ b/t/pragma/warn/7fatal
@@ -3,15 +3,15 @@ Check FATAL functionality
__END__
# Check compile time warning
-use warnings FATAL => 'syntax' ;
+use warnings FATAL => 'deprecated' ;
{
no warnings ;
- $a =+ 1 ;
+ 1 if $a EQ $b ;
}
-$a =+ 1 ;
+1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
-Reversed += operator at - line 8.
+Use of EQ is deprecated at - line 8.
########
# Check compile time warning
@@ -75,28 +75,28 @@ Use of uninitialized value in scalar chop at - line 6.
########
--FILE-- abc
-$a =+ 1 ;
+1 if $a EQ $b ;
1;
--FILE--
-use warnings FATAL => 'syntax' ;
+use warnings FATAL => 'deprecated' ;
require "./abc";
EXPECT
########
--FILE-- abc
-use warnings FATAL => 'syntax' ;
+use warnings FATAL => 'deprecated' ;
1;
--FILE--
require "./abc";
-$a =+ 1 ;
+1 if $a EQ $b ;
EXPECT
########
--FILE-- abc
-use warnings 'syntax' ;
-$a =+ 1 ;
+use warnings 'deprecated' ;
+1 if $a EQ $b ;
1;
--FILE--
use warnings FATAL => 'uninitialized' ;
@@ -104,13 +104,13 @@ require "./abc";
my $a ; chop $a ;
print STDERR "The End.\n" ;
EXPECT
-Reversed += operator at ./abc line 2.
+Use of EQ is deprecated at ./abc line 2.
Use of uninitialized value in scalar chop at - line 3.
########
--FILE-- abc.pm
-use warnings 'syntax' ;
-$a =+ 1 ;
+use warnings 'deprecated' ;
+1 if $a EQ $b ;
1;
--FILE--
use warnings FATAL => 'uninitialized' ;
@@ -118,7 +118,7 @@ use abc;
my $a ; chop $a ;
print STDERR "The End.\n" ;
EXPECT
-Reversed += operator at abc.pm line 2.
+Use of EQ is deprecated at abc.pm line 2.
Use of uninitialized value in scalar chop at - line 3.
########
@@ -162,44 +162,44 @@ Use of uninitialized value in scalar chop at - line 8.
# Check scope of pragma with eval
no warnings ;
eval {
- use warnings FATAL => 'syntax' ;
- $a =+ 1 ;
+ use warnings FATAL => 'deprecated' ;
+ 1 if $a EQ $b ;
}; print STDERR "-- $@" ;
-$a =+ 1 ;
+1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
-Reversed += operator at - line 6.
+Use of EQ is deprecated at - line 6.
########
# Check scope of pragma with eval
-use warnings FATAL => 'syntax' ;
+use warnings FATAL => 'deprecated' ;
eval {
- $a =+ 1 ;
+ 1 if $a EQ $b ;
}; print STDERR "-- $@" ;
-$a =+ 1 ;
+1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
-Reversed += operator at - line 5.
+Use of EQ is deprecated at - line 5.
########
# Check scope of pragma with eval
-use warnings FATAL => 'syntax' ;
+use warnings FATAL => 'deprecated' ;
eval {
no warnings ;
- $a =+ 1 ;
+ 1 if $a EQ $b ;
}; print STDERR $@ ;
-$a =+ 1 ;
+1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
-Reversed += operator at - line 8.
+Use of EQ is deprecated at - line 8.
########
# Check scope of pragma with eval
no warnings ;
eval {
- use warnings FATAL => 'syntax' ;
+ use warnings FATAL => 'deprecated' ;
}; print STDERR $@ ;
-$a =+ 1 ;
+1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
The End.
@@ -245,34 +245,34 @@ Use of uninitialized value in scalar chop at - line 8.
# Check scope of pragma with eval
no warnings ;
eval q[
- use warnings FATAL => 'syntax' ;
- $a =+ 1 ;
+ use warnings FATAL => 'deprecated' ;
+ 1 if $a EQ $b ;
]; print STDERR "-- $@";
-$a =+ 1 ;
+1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
--- Reversed += operator at (eval 1) line 3.
+-- Use of EQ is deprecated at (eval 1) line 3.
The End.
########
# Check scope of pragma with eval
-use warnings FATAL => 'syntax' ;
+use warnings FATAL => 'deprecated' ;
eval '
- $a =+ 1 ;
+ 1 if $a EQ $b ;
'; print STDERR "-- $@";
print STDERR "The End.\n" ;
EXPECT
--- Reversed += operator at (eval 1) line 2.
+-- Use of EQ is deprecated at (eval 1) line 2.
The End.
########
# Check scope of pragma with eval
-use warnings FATAL => 'syntax' ;
+use warnings FATAL => 'deprecated' ;
eval '
no warnings ;
- $a =+ 1 ;
+ 1 if $a EQ $b ;
'; print STDERR "-- $@";
-$a =+ 1 ;
+1 if $a EQ $b ;
print STDERR "The End.\n" ;
EXPECT
-Reversed += operator at - line 8.
+Use of EQ is deprecated at - line 8.
diff --git a/t/pragma/warn/8signal b/t/pragma/warn/8signal
index cc1b9d926d..d480f1902a 100644
--- a/t/pragma/warn/8signal
+++ b/t/pragma/warn/8signal
@@ -6,13 +6,13 @@ __END__
# 8signal
BEGIN { $| = 1; $SIG{__WARN__} = sub { print "WARN -- @_" } }
BEGIN { $SIG{__DIE__} = sub { print "DIE -- @_" } }
-$a =+ 1 ;
-use warnings qw(syntax) ;
-$a =+ 1 ;
-use warnings FATAL => qw(syntax) ;
-$a =+ 1 ;
+1 if 1 EQ 2 ;
+use warnings qw(deprecated) ;
+1 if 1 EQ 2 ;
+use warnings FATAL => qw(deprecated) ;
+1 if 1 EQ 2 ;
print "The End.\n" ;
EXPECT
-WARN -- Reversed += operator at - line 6.
-DIE -- Reversed += operator at - line 8.
-Reversed += operator at - line 8.
+WARN -- Use of EQ is deprecated at - line 6.
+DIE -- Use of EQ is deprecated at - line 8.
+Use of EQ is deprecated at - line 8.
diff --git a/t/pragma/warn/toke b/t/pragma/warn/toke
index 267adccfb6..64f5368588 100644
--- a/t/pragma/warn/toke
+++ b/t/pragma/warn/toke
@@ -3,6 +3,12 @@ toke.c AOK
we seem to have lost a few ambiguous warnings!!
+ 1 if $a EQ $b ;
+ 1 if $a NE $b ;
+ 1 if $a LT $b ;
+ 1 if $a GT $b ;
+ 1 if $a GE $b ;
+ 1 if $a LE $b ;
$a = <<;
Use of comma-less variable list is deprecated
(called 3 times via depcom)
@@ -125,6 +131,27 @@ toke.c AOK
__END__
# toke.c
+use warnings 'deprecated' ;
+1 if $a EQ $b ;
+1 if $a NE $b ;
+1 if $a GT $b ;
+1 if $a LT $b ;
+1 if $a GE $b ;
+1 if $a LE $b ;
+no warnings 'deprecated' ;
+1 if $a EQ $b ;
+1 if $a NE $b ;
+1 if $a GT $b ;
+1 if $a LT $b ;
+1 if $a GE $b ;
+1 if $a LE $b ;
+EXPECT
+Use of EQ is deprecated at - line 3.
+Use of NE is deprecated at - line 4.
+Use of GT is deprecated at - line 5.
+Use of LT is deprecated at - line 6.
+Use of GE is deprecated at - line 7.
+Use of LE is deprecated at - line 8.
########
# toke.c
use warnings 'deprecated' ;