summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-08-27 15:46:54 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-08-27 15:46:54 +0000
commit9c6390c7ad8dcac609f8f9590b6756f434a7b024 (patch)
tree9b5543e7c4f05d7dcb0bdfcca9327dd913f2387e
parent4e3c68f2d6398ba858f4200b23f0f9f65c7aeeff (diff)
downloadperl-9c6390c7ad8dcac609f8f9590b6756f434a7b024.tar.gz
Regression test for attributes 'reserved' warning,
by Jerry D. Hedden p4raw-id: //depot/perl@28761
-rw-r--r--t/op/attrs.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/op/attrs.t b/t/op/attrs.t
index 10e2c2493c..abfdb2ce70 100644
--- a/t/op/attrs.t
+++ b/t/op/attrs.t
@@ -1,7 +1,9 @@
-#!./perl -w
+#!./perl
# Regression tests for attributes.pm and the C< : attrs> syntax.
+use warnings;
+
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
@@ -81,6 +83,10 @@ like $@, qr/^SCALAR package attribute may clash with future reserved word: ["']?
eval 'my A $x : plugh plover;';
like $@, qr/^SCALAR package attributes may clash with future reserved words: ["']?plugh["']? /;
+no warnings 'reserved';
+eval 'my A $x : plugh;';
+is $@, '';
+
eval 'package Cat; my Cat @socks;';
like $@, qr/^Can't declare class for non-scalar \@socks in "my"/;