diff options
author | Steve Grazzini <grazz@pobox.com> | 2003-06-18 15:42:37 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-19 14:08:13 +0000 |
commit | 7ff032551aa263179d4cb6df3dd91502d713e6ba (patch) | |
tree | 7dd25bf874fe4d2842d7e56fa2b9da375cf60df3 /t | |
parent | ca9279baf07d6843f58a31f1ce3ff7dc875faf1a (diff) | |
download | perl-7ff032551aa263179d4cb6df3dd91502d713e6ba.tar.gz |
Re: [perl #17934] tied STDERR and internal warnings
Message-ID: <20030618234237.GA6267@grazzini.net>
p4raw-id: //depot/perl@19819
Diffstat (limited to 't')
-rwxr-xr-x | t/op/runlevel.t | 33 | ||||
-rwxr-xr-x | t/op/tiehandle.t | 7 |
2 files changed, 39 insertions, 1 deletions
diff --git a/t/op/runlevel.t b/t/op/runlevel.t index fffe103836..531b862fd8 100755 --- a/t/op/runlevel.t +++ b/t/op/runlevel.t @@ -374,3 +374,36 @@ sub d { } EXPECT 0 +######## +sub TIEHANDLE { bless {} } +sub PRINT { next } + +tie *STDERR, ''; +{ map ++$_, 1 } + +EXPECT +Can't "next" outside a loop block at - line 2. +######## +sub TIEHANDLE { bless {} } +sub PRINT { print "[TIE] $_[1]" } + +tie *STDERR, ''; +die "DIE\n"; + +EXPECT +[TIE] DIE +######## +sub TIEHANDLE { bless {} } +sub PRINT { + (split(/./, 'x'x10000))[0]; + eval('die("test\n")'); + warn "[TIE] $_[1]"; +} +open OLDERR, '>&STDERR'; +tie *STDERR, ''; + +use warnings FATAL => qw(uninitialized); +print undef; + +EXPECT +[TIE] Use of uninitialized value in print at - line 11. diff --git a/t/op/tiehandle.t b/t/op/tiehandle.t index 818cecf185..3442e6bc3e 100755 --- a/t/op/tiehandle.t +++ b/t/op/tiehandle.t @@ -77,7 +77,7 @@ package main; use Symbol; -print "1..40\n"; +print "1..41\n"; my $fh = gensym; @@ -228,6 +228,11 @@ ok($r == 1); @expect = (PRINT => $ob,"sometext\n"); Implement::compare(PRINT => @received); + + use warnings; + print undef; + + ok($received[1] =~ /Use of uninitialized value/); } { |