print $_[1] ? "ok " : "not ok ", $_[0], "\n";
}
-print "1..18\n";
+print "1..20\n";
my $NEWPROTO = 'Prototype mismatch:';
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;
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 =
.
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 =
.