summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/pragma/warn/7fatal
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/t/pragma/warn/7fatal')
-rw-r--r--contrib/perl5/t/pragma/warn/7fatal70
1 files changed, 70 insertions, 0 deletions
diff --git a/contrib/perl5/t/pragma/warn/7fatal b/contrib/perl5/t/pragma/warn/7fatal
index 943bb06f..ed585c2 100644
--- a/contrib/perl5/t/pragma/warn/7fatal
+++ b/contrib/perl5/t/pragma/warn/7fatal
@@ -14,6 +14,18 @@ EXPECT
Use of EQ is deprecated at - line 8.
########
+# Check compile time warning
+use warnings FATAL => 'all' ;
+{
+ no warnings ;
+ 1 if $a EQ $b ;
+}
+1 if $a EQ $b ;
+print STDERR "The End.\n" ;
+EXPECT
+Use of EQ is deprecated at - line 8.
+########
+
# Check runtime scope of pragma
use warnings FATAL => 'uninitialized' ;
{
@@ -27,6 +39,18 @@ Use of uninitialized value in scalar chop at - line 8.
########
# Check runtime scope of pragma
+use warnings FATAL => 'all' ;
+{
+ no warnings ;
+ my $b ; chop $b ;
+}
+my $b ; chop $b ;
+print STDERR "The End.\n" ;
+EXPECT
+Use of uninitialized value in scalar chop at - line 8.
+########
+
+# Check runtime scope of pragma
no warnings ;
{
use warnings FATAL => 'uninitialized' ;
@@ -38,6 +62,18 @@ EXPECT
Use of uninitialized value in scalar chop at - line 6.
########
+# Check runtime scope of pragma
+no warnings ;
+{
+ use warnings FATAL => 'all' ;
+ $a = sub { my $b ; chop $b ; }
+}
+&$a ;
+print STDERR "The End.\n" ;
+EXPECT
+Use of uninitialized value in scalar chop at - line 6.
+########
+
--FILE-- abc
1 if $a EQ $b ;
1;
@@ -240,3 +276,37 @@ eval '
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at - line 8.
+########
+
+use warnings 'void' ;
+
+time ;
+
+{
+ use warnings FATAL => qw(void) ;
+ length "abc" ;
+}
+
+join "", 1,2,3 ;
+
+print "done\n" ;
+EXPECT
+Useless use of time in void context at - line 4.
+Useless use of length in void context at - line 8.
+########
+
+use warnings ;
+
+time ;
+
+{
+ use warnings FATAL => qw(void) ;
+ length "abc" ;
+}
+
+join "", 1,2,3 ;
+
+print "done\n" ;
+EXPECT
+Useless use of time in void context at - line 4.
+Useless use of length in void context at - line 8.
OpenPOWER on IntegriCloud