X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F22-bad-fatal.t;h=111524d5a2d1f169b73b7c55b0f43965fdcbb1c9;hp=64348d91cc0384e91add4ac53f3fc9fc8360d91f;hb=7f756d0f409eb87eb7900dafdb81428e4367021b;hpb=c579771bace4977e6f2c26a5e5e29740a1aa4553 diff --git a/t/22-bad-fatal.t b/t/22-bad-fatal.t index 64348d9..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 '', @$stderr; +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');