]> git.vpit.fr Git - perl/modules/indirect.git/blob - t/22-bad-fatal.t
Better logic for finding oo and om in ck_entersub
[perl/modules/indirect.git] / t / 22-bad-fatal.t
1 #!perl
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 use IPC::Cmd qw/run/;
9
10 (my $success, my $err_code, undef, undef, my $stderr)
11  = run command => [
12           $^X,
13           map('-I' . $_, @INC),
14           $ENV{PERL5OPT} || '',
15           '-M-indirect=:fatal',
16           '-c',
17           't/data/bad.d'
18    ];
19
20 plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr;
21 plan tests => 1;
22
23 $stderr = join '', @{$stderr || []};
24 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');