From: Vincent Pit Date: Tue, 12 Aug 2008 15:15:28 +0000 (+0200) Subject: Add undef guards to $stderr in tests X-Git-Tag: v0.03~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=89371b5b8966e2ea12eb637b830034e1308762b0;p=perl%2Fmodules%2Findirect.git Add undef guards to $stderr in tests --- diff --git a/t/10-good-no.t b/t/10-good-no.t index 51c3d8f..501b27d 100644 --- a/t/10-good-no.t +++ b/t/10-good-no.t @@ -22,7 +22,7 @@ use IPC::Cmd qw/run/; plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; plan tests => $total + 1; -$stderr = join '', @$stderr; +$stderr = join '', @{$stderr || []}; unless ($success) { diag $stderr; diag "Failed to execute data file (error $err_code)"; diff --git a/t/11-good-use.t b/t/11-good-use.t index 2e8035e..6f00254 100644 --- a/t/11-good-use.t +++ b/t/11-good-use.t @@ -22,7 +22,7 @@ use IPC::Cmd qw/run/; plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; plan tests => $total + 1; -$stderr = join '', @$stderr; +$stderr = join '', @{$stderr || []}; unless ($success) { diag $stderr; diag "Failed to execute data file (error $err_code)"; diff --git a/t/20-bad-no.t b/t/20-bad-no.t index 5d82d95..fbfceaf 100644 --- a/t/20-bad-no.t +++ b/t/20-bad-no.t @@ -22,7 +22,7 @@ use IPC::Cmd qw/run/; plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; plan tests => $total + 1; -$stderr = join '', @$stderr; +$stderr = join '', @{$stderr || []}; unless ($success) { diag $stderr; diag "Failed to execute data file (error $err_code)"; diff --git a/t/21-bad-use.t b/t/21-bad-use.t index f678695..dca71d4 100644 --- a/t/21-bad-use.t +++ b/t/21-bad-use.t @@ -22,7 +22,7 @@ use IPC::Cmd qw/run/; plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; plan tests => $total + 1; -$stderr = join '', @$stderr; +$stderr = join '', @{$stderr || []}; unless ($success) { diag $stderr; diag "Failed to execute data file (error $err_code)"; diff --git a/t/22-bad-fatal.t b/t/22-bad-fatal.t index d87fbb6..111524d 100644 --- a/t/22-bad-fatal.t +++ b/t/22-bad-fatal.t @@ -20,5 +20,5 @@ use IPC::Cmd qw/run/; plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; plan tests => 1; -$stderr = join '', @$stderr; +$stderr = join '', @{$stderr || []}; ok(!$success && $err_code && $stderr =~ /^Indirect\s+call\s+of\s+method\s+"new"\s+on\s+object\s+"Hlagh1"/mg, 'croak when :fatal is specified'); diff --git a/t/30-scope.t b/t/30-scope.t index 2eceddb..e4d667c 100644 --- a/t/30-scope.t +++ b/t/30-scope.t @@ -21,7 +21,7 @@ use IPC::Cmd qw/run/; plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; plan tests => $total + 1; -$stderr = join '', @$stderr; +$stderr = join '', @{$stderr || []}; unless ($success) { diag $stderr; diag "Failed to execute data file (error $err_code)";