From: Rafael Garcia-Suarez Date: Sun, 27 Aug 2006 15:46:54 +0000 (+0000) Subject: Regression test for attributes 'reserved' warning, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9c6390c7ad8dcac609f8f9590b6756f434a7b024;p=p5sagit%2Fp5-mst-13.2.git Regression test for attributes 'reserved' warning, by Jerry D. Hedden p4raw-id: //depot/perl@28761 --- diff --git a/t/op/attrs.t b/t/op/attrs.t index 10e2c24..abfdb2c 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"/;