]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/22-bad-fatal.t
Better logic for finding oo and om in ck_entersub
[perl/modules/indirect.git] / t / 22-bad-fatal.t
index 6fd910a4a6c3d1d5e87360c39723d0363c3b8130..111524d5a2d1f169b73b7c55b0f43965fdcbb1c9 100644 (file)
@@ -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');