diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2003-01-23 20:56:47 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-01-23 20:46:00 +0000 |
commit | f21d7107612aaee31e255b36dd90c915f569c210 (patch) | |
tree | 14a7ccac308447161f829bd8ad13cae47bb5bc53 /t | |
parent | 673c27c1f741b8f21e9f8e87048c7df824507930 (diff) | |
download | perl-f21d7107612aaee31e255b36dd90c915f569c210.tar.gz |
move pad.c warnings to different test file
Message-ID: <20030123205647.C8696@fdgroup.com>
p4raw-id: //depot/perl@18577
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/op | 88 | ||||
-rw-r--r-- | t/lib/warnings/pad | 105 |
2 files changed, 105 insertions, 88 deletions
diff --git a/t/lib/warnings/op b/t/lib/warnings/op index c5f8147a5c..3e8261b184 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -1,25 +1,5 @@ op.c AOK - "my" variable %s masks earlier declaration in same scope - my $x; - my $x ; - - Variable "%s" may be unavailable - sub x { - my $x; - sub y { - $x - } - } - - Variable "%s" will not stay shared - sub x { - my $x; - sub y { - sub { $x } - } - } - Found = in conditional, should be == 1 if $a = 1 ; @@ -118,80 +98,12 @@ sub fred() ; sub fred($) {} - %s never introduced [pad_leavemy] TODO Runaway prototype [newSUB] TODO oops: oopsAV [oopsAV] TODO oops: oopsHV [oopsHV] TODO __END__ # op.c -use warnings 'misc' ; -my $x ; -my $x ; -my $y = my $y ; -no warnings 'misc' ; -my $x ; -my $y ; -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. -######## -# op.c -use warnings 'closure' ; -sub x { - my $x; - sub y { - $x - } - } -EXPECT -Variable "$x" will not stay shared at - line 7. -######## -# op.c -no warnings 'closure' ; -sub x { - my $x; - sub y { - $x - } - } -EXPECT - -######## -# op.c -use warnings 'closure' ; -sub x { - our $x; - sub y { - $x - } - } -EXPECT - -######## -# op.c -use warnings 'closure' ; -sub x { - my $x; - sub y { - sub { $x } - } - } -EXPECT -Variable "$x" may be unavailable at - line 6. -######## -# op.c -no warnings 'closure' ; -sub x { - my $x; - sub y { - sub { $x } - } - } -EXPECT - -######## -# op.c use warnings 'syntax' ; 1 if $a = 1 ; no warnings 'syntax' ; diff --git a/t/lib/warnings/pad b/t/lib/warnings/pad new file mode 100644 index 0000000000..7dd28762f1 --- /dev/null +++ b/t/lib/warnings/pad @@ -0,0 +1,105 @@ + pad.c AOK + + "my" variable %s masks earlier declaration in same scope + my $x; + my $x ; + + Variable "%s" may be unavailable + sub x { + my $x; + sub y { + $x + } + } + + Variable "%s" will not stay shared + sub x { + my $x; + sub y { + sub { $x } + } + } + "our" variable %s redeclared (Did you mean "local" instead of "our"?) + our $x; + { + our $x; + } + + %s never introduced [pad_leavemy] TODO + +__END__ +# pad.c +use warnings 'misc' ; +my $x ; +my $x ; +my $y = my $y ; +no warnings 'misc' ; +my $x ; +my $y ; +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 +use warnings 'closure' ; +sub x { + my $x; + sub y { + $x + } + } +EXPECT +Variable "$x" will not stay shared at - line 7. +######## +# pad.c +no warnings 'closure' ; +sub x { + my $x; + sub y { + $x + } + } +EXPECT + +######## +# pad.c +use warnings 'closure' ; +sub x { + our $x; + sub y { + $x + } + } +EXPECT + +######## +# pad.c +use warnings 'closure' ; +sub x { + my $x; + sub y { + sub { $x } + } + } +EXPECT +Variable "$x" may be unavailable at - line 6. +######## +# pad.c +no warnings 'closure' ; +sub x { + my $x; + sub y { + sub { $x } + } + } +EXPECT + +######## +use warnings 'misc' ; +our $x; +{ + our $x; +} +EXPECT +"our" variable $x redeclared at - line 4. + (Did you mean "local" instead of "our"?) |