summaryrefslogtreecommitdiff
path: root/t/pragma/warn/6default
diff options
context:
space:
mode:
Diffstat (limited to 't/pragma/warn/6default')
-rw-r--r--t/pragma/warn/6default34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/pragma/warn/6default b/t/pragma/warn/6default
new file mode 100644
index 0000000000..c095b20827
--- /dev/null
+++ b/t/pragma/warn/6default
@@ -0,0 +1,34 @@
+Check default warnings
+
+__END__
+# default warning should be displayed if you don't add anything
+# optional shouldn't
+my $a = oct "7777777777777777777777777777777777779" ;
+EXPECT
+Integer overflow in octal number at - line 3.
+########
+# no warning should be displayed
+no warning ;
+my $a = oct "7777777777777777777777777777777777779" ;
+EXPECT
+########
+# all warning should be displayed
+use warning ;
+my $a = oct "7777777777777777777777777777777777779" ;
+EXPECT
+Integer overflow in octal number at - line 3.
+Illegal octal digit '9' ignored at - line 3.
+########
+# check scope
+use warning ;
+my $a = oct "7777777777777777777777777777777777779" ;
+{
+ no warning ;
+ my $a = oct "7777777777777777777777777777777777779" ;
+}
+my $c = oct "7777777777777777777777777777777777779" ;
+EXPECT
+Integer overflow in octal number at - line 3.
+Illegal octal digit '9' ignored at - line 3.
+Integer overflow in octal number at - line 8.
+Illegal octal digit '9' ignored at - line 8.