From: Rafael Garcia-Suarez Date: Fri, 14 Nov 2003 22:35:20 +0000 (+0000) Subject: Add more complete tests for the "variable masks earlier X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f793795c1b9a4b2cb1fd1acf149f94c5729d3f49;p=p5sagit%2Fp5-mst-13.2.git Add more complete tests for the "variable masks earlier declaration" warning, including a TODO test p4raw-id: //depot/perl@21725 --- diff --git a/t/lib/warnings/pad b/t/lib/warnings/pad index 568e2f4..f0dce60 100644 --- a/t/lib/warnings/pad +++ b/t/lib/warnings/pad @@ -41,6 +41,45 @@ EXPECT "my" variable $y masks earlier declaration in same statement at - line 5. ######## # pad.c +use warnings 'misc' ; +our $x ; +our $x ; +our $y = our $y ; +no warnings 'misc' ; +our $x ; +our $y ; +EXPECT +"our" variable $x masks earlier declaration in same scope at - line 4. +"our" variable $y masks earlier declaration in same statement at - line 5. +######## +# pad.c +use warnings 'misc' ; +our $x ; +my $x ; +our $y = my $y ; +no warnings 'misc' ; +our $z ; +my $z ; +our $t = my $t ; +EXPECT +"my" variable $x masks earlier declaration in same scope at - line 4. +"my" variable $y masks earlier declaration in same statement at - line 5. +######## +# pad.c +# TODO not implemented yet +use warnings 'misc' ; +my $x ; +our $x ; +my $y = our $y ; +no warnings 'misc' ; +my $z ; +our $z ; +my $t = our $t ; +EXPECT +"our" variable $x masks earlier declaration in same scope at - line 5. +"our" variable $y masks earlier declaration in same statement at - line 6. +######## +# pad.c use warnings 'closure' ; sub x { my $x;