diff options
-rwxr-xr-x | t/comp/redef.t | 14 | ||||
-rw-r--r-- | t/pragma/warn/op | 15 |
2 files changed, 10 insertions, 19 deletions
diff --git a/t/comp/redef.t b/t/comp/redef.t index 07e978bb86..328b44d3c8 100755 --- a/t/comp/redef.t +++ b/t/comp/redef.t @@ -11,7 +11,7 @@ sub ok ($$) { print $_[1] ? "ok " : "not ok ", $_[0], "\n"; } -print "1..18\n"; +print "1..20\n"; my $NEWPROTO = 'Prototype mismatch:'; @@ -72,9 +72,15 @@ sub sub9 ($) { 2 } ok 16, $warn =~ s/$NEWPROTO sub main::sub9 \(\$\Q@) vs ($)\E[^\n]+\n//s; ok 17, $warn =~ s/Subroutine sub9 redefined[^\n]+\n//s; -ok 18, $_ eq ''; +BEGIN { + local $^W = 0; + eval qq(sub sub10 () {1} sub sub10 {1}); +} -# If we got any errors that we were not expecting, then print them -print $_ if length $_; +ok 18, $warn =~ s/$NEWPROTO \Qsub main::sub10 () vs none\E[^\n]+\n//s; +ok 19, $warn =~ s/Constant subroutine sub10 redefined[^\n]+\n//s; +ok 20, $warn eq ''; +# If we got any errors that we were not expecting, then print them +print $warn if length $warn; diff --git a/t/pragma/warn/op b/t/pragma/warn/op index 0163d76a45..de326f8b0c 100644 --- a/t/pragma/warn/op +++ b/t/pragma/warn/op @@ -71,13 +71,6 @@ Constant subroutine %s redefined sub fred() {1;} sub fred() {1;} - Constant subroutine %s redefined - sub fred() {1;} sub fred() {1;} - - Prototype mismatch: sub main::foo () vs none - Constant subroutine foo redefined - sub foo () {1} sub foo {1} - Format FRED redefined at /tmp/x line 5. format FRED = . @@ -737,14 +730,6 @@ EXPECT Constant subroutine fred redefined at - line 4. ######## # op.c -use warnings; -sub foo () {1} -sub foo {1} -EXPECT -Prototype mismatch: sub main::foo () vs none at - line 4. -Constant subroutine foo redefined at - line 4. -######## -# op.c use warnings 'redefine' ; format FRED = . |