From: Graham Knop Date: Wed, 27 May 2015 07:08:11 +0000 (-0400) Subject: wait until STDERR is restored before rethrowing error in test X-Git-Tag: v2.000001~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Fstrictures.git;a=commitdiff_plain;h=9e56bf631467f5275c3110e353f057b66dcde123 wait until STDERR is restored before rethrowing error in test --- diff --git a/t/extras.t b/t/extras.t index cef6a6c..2763d1c 100644 --- a/t/extras.t +++ b/t/extras.t @@ -90,14 +90,16 @@ use strictures; { open my $fh, '>', \(my $str = ''); + my $e; { local *STDERR = $fh; eval qq{ #line 1 "t/load_fail.t" use strictures; 1; - } or die "$@"; + } or $e = "$@"; } + die $e if defined $e; strictures->import; like( @@ -109,14 +111,16 @@ use strictures; { open my $fh, '>', \(my $str = ''); + my $e; { local *STDERR = $fh; eval qq{ #line 1 "t/load_fail.t" use strictures; 1; - } or die "$@"; + } or $e = "$@"; } + die $e if defined $e; is $str, '', "extra dep load failure is not reported a second time"; }