summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-10-08 10:18:31 +0200
committerNicholas Clark <nick@ccl4.org>2009-10-08 14:35:40 +0200
commitf3ca7babe1885e6681f31690f657a7eada6dbb41 (patch)
treea964ca97a11fc90c7711172f53d5c83adc399af4 /t
parentf4817f32b1c5f1cefe556cf79f36f874b67cad16 (diff)
downloadperl-f3ca7babe1885e6681f31690f657a7eada6dbb41.tar.gz
Avoid using the warnings pragma in proto.t - use may not work yet.
Diffstat (limited to 't')
-rw-r--r--t/comp/proto.t18
1 files changed, 15 insertions, 3 deletions
diff --git a/t/comp/proto.t b/t/comp/proto.t
index 1f5ed30fcf..734a68bdfc 100644
--- a/t/comp/proto.t
+++ b/t/comp/proto.t
@@ -14,9 +14,11 @@ BEGIN {
@INC = '../lib';
}
+# We need this, as in places we're testing the interaction of prototypes with
+# strict
use strict;
-print "1..141\n";
+print "1..153\n";
my $i = 1;
@@ -549,11 +551,21 @@ sub sreftest (\$$) {
# string "parse error".
#
for my $p ( "", qw{ () ($) ($@) ($%) ($;$) (&) (&\@) (&@) (%) (\%) (\@) } ) {
- no warnings 'prototype';
+ my $warn = "";
+ local $SIG{__WARN__} = sub {
+ my $thiswarn = join("",@_);
+ return if $thiswarn =~ /^Prototype mismatch: sub main::evaled_subroutine/;
+ $warn .= $thiswarn;
+ };
my $eval = "sub evaled_subroutine $p { &void *; }";
eval $eval;
print "# eval[$eval]\nnot " unless $@ && $@ =~ /(parse|syntax) error/i;
print "ok ", $i++, "\n";
+ if ($warn eq '') {
+ print "ok ", $i++, "\n";
+ } else {
+ print "not ok ", $i++, "# $warn \n";
+ }
}
# Not $$;$;$
@@ -609,7 +621,7 @@ print "ok ", $i++, "\n";
# check that obviously bad prototypes are getting warnings
{
- use warnings 'syntax';
+ local $^W = 1;
my $warn = "";
local $SIG{__WARN__} = sub { $warn .= join("",@_) };