diff options
Diffstat (limited to 't/lib/warnings/pad')
-rw-r--r-- | t/lib/warnings/pad | 62 |
1 files changed, 51 insertions, 11 deletions
diff --git a/t/lib/warnings/pad b/t/lib/warnings/pad index f25452f81a..bf5c367fc9 100644 --- a/t/lib/warnings/pad +++ b/t/lib/warnings/pad @@ -1,6 +1,6 @@ pad.c AOK - "my" variable %s masks earlier declaration in same scope + "%s" variable %s masks earlier declaration in same scope my $x; my $x ; @@ -49,16 +49,6 @@ EXPECT # pad.c use warnings 'misc' ; our $x ; -our $x ; -our $y = our $y ; -our $p ; -package X ; -our $p ; -EXPECT -######## -# pad.c -use warnings 'misc' ; -our $x ; my $x ; our $y = my $y ; our $p ; @@ -244,20 +234,53 @@ my $x; } EXPECT ######## +# pad.c +use warnings 'misc' ; +our $x ; +our $x ; +our $y = our $y ; +our $p ; +package X ; +our $p ; +package main ; +no warnings 'misc' ; +our $a ; +our $a ; +our $b = our $b ; +our $c ; +package X ; +our $c ; +EXPECT +"our" variable $x redeclared at - line 4. +"our" variable $y redeclared at - line 5. +######## use warnings 'misc' ; our $x; { our $x; } +our $x; +no warnings 'misc' ; +our $y; +{ + our $y; +} +our $y; EXPECT "our" variable $x redeclared at - line 4. (Did you mean "local" instead of "our"?) +"our" variable $x redeclared at - line 6. ######## use warnings 'misc' ; our $x; { my $x; } +no warnings 'misc' ; +our $y; +{ + my $y; +} EXPECT ######## use warnings 'misc' ; @@ -265,6 +288,23 @@ my $x; { our $x; } +no warnings 'misc' ; +my $y; +{ + our $y; +} +EXPECT +######## +use warnings 'misc' ; +my $x; +{ + my $x; +} +no warnings 'misc' ; +my $y; +{ + my $y; +} EXPECT ######## # an our var being introduced should suppress errors about global syms |