summaryrefslogtreecommitdiff
path: root/t/pragma/warn/7fatal
diff options
context:
space:
mode:
Diffstat (limited to 't/pragma/warn/7fatal')
-rw-r--r--t/pragma/warn/7fatal36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/pragma/warn/7fatal b/t/pragma/warn/7fatal
index 943bb06fb3..2d29ddbd82 100644
--- a/t/pragma/warn/7fatal
+++ b/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;