X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F22-bad-fatal.t;h=111524d5a2d1f169b73b7c55b0f43965fdcbb1c9;hp=6fd910a4a6c3d1d5e87360c39723d0363c3b8130;hb=7f756d0f409eb87eb7900dafdb81428e4367021b;hpb=79fe38872567977419089da38eac9406bf2d4afa diff --git a/t/22-bad-fatal.t b/t/22-bad-fatal.t index 6fd910a..111524d 100644 --- a/t/22-bad-fatal.t +++ b/t/22-bad-fatal.t @@ -3,12 +3,7 @@ use strict; use warnings; -my $total; -BEGIN { - $total = 20; -} - -use Test::More tests => 1; +use Test::More; use IPC::Cmd qw/run/; @@ -16,10 +11,14 @@ use IPC::Cmd qw/run/; = run command => [ $^X, map('-I' . $_, @INC), + $ENV{PERL5OPT} || '', '-M-indirect=:fatal', '-c', 't/data/bad.d' ]; -$stderr = join "\n", @$stderr if ref $stderr eq 'ARRAY'; +plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr; +plan tests => 1; + +$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');