From: John Tobey Date: Sun, 22 Oct 2000 04:04:12 +0000 (-0400) Subject: Move the #7390 test from warn/op to comp/redef. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=08f31b3d3711053ee5547c6a55c4bef4c4a8075d;p=p5sagit%2Fp5-mst-13.2.git Move the #7390 test from warn/op to comp/redef. Subject: Re: Creating const subs for constants. Message-Id: p4raw-id: //depot/perl@7400 --- diff --git a/t/comp/redef.t b/t/comp/redef.t index 07e978b..328b44d 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 0163d76..de326f8 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 = .