From: Jarkko Hietaniemi Date: Mon, 28 May 2001 15:48:46 +0000 (+0000) Subject: STDERR looks much like STDOUT. (Subtest #2 wasn't really okay.) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1115139db3eaa371c914ed4ef12a3a4846e77705;p=p5sagit%2Fp5-mst-13.2.git STDERR looks much like STDOUT. (Subtest #2 wasn't really okay.) p4raw-id: //depot/perl@10259 --- diff --git a/t/lib/carp.t b/t/lib/carp.t index 0e63382..a318c19 100644 --- a/t/lib/carp.t +++ b/t/lib/carp.t @@ -9,17 +9,23 @@ print "1..7\n"; print "ok 1\n"; -carp "ok 2\n"; +$SIG{__WARN__} = sub { + print "ok $1\n" + if $_[0] =~ m!ok (\d+)$! }; -$SIG{__WARN__} = sub { print "ok $1\n" - if $_[0] =~ m!(\d+) at .+\b(?i:carp\.t) line \d+$! }; +carp "ok 2\n"; + +$SIG{__WARN__} = sub { + print "ok $1\n" + if $_[0] =~ m!(\d+) at .+\b(?i:carp\.t) line \d+$! }; carp 3; sub sub_4 { -$SIG{__WARN__} = sub { print "ok $1\n" - if $_[0] =~ m!^(\d+) at .+\b(?i:carp\.t) line \d+\n\tmain::sub_4\(\) called at .+\b(?i:carp\.t) line \d+$! }; +$SIG{__WARN__} = sub { + print "ok $1\n" + if $_[0] =~ m!^(\d+) at .+\b(?i:carp\.t) line \d+\n\tmain::sub_4\(\) called at .+\b(?i:carp\.t) line \d+$! }; cluck 4; @@ -27,14 +33,16 @@ cluck 4; sub_4; -$SIG{__DIE__} = sub { print "ok $1\n" - if $_[0] =~ m!^(\d+) at .+\b(?i:carp\.t) line \d+\n\teval \Q{...}\E called at .+\b(?i:carp\.t) line \d+$! }; +$SIG{__DIE__} = sub { + print "ok $1\n" + if $_[0] =~ m!^(\d+) at .+\b(?i:carp\.t) line \d+\n\teval \Q{...}\E called at .+\b(?i:carp\.t) line \d+$! }; eval { croak 5 }; sub sub_6 { - $SIG{__DIE__} = sub { print "ok $1\n" - if $_[0] =~ m!^(\d+) at .+\b(?i:carp\.t) line \d+\n\teval \Q{...}\E called at .+\b(?i:carp\.t) line \d+\n\tmain::sub_6\(\) called at .+\b(?i:carp\.t) line \d+$! }; + $SIG{__DIE__} = sub { + print "ok $1\n" + if $_[0] =~ m!^(\d+) at .+\b(?i:carp\.t) line \d+\n\teval \Q{...}\E called at .+\b(?i:carp\.t) line \d+\n\tmain::sub_6\(\) called at .+\b(?i:carp\.t) line \d+$! }; eval { confess 6 }; }