]> git.vpit.fr Git - perl/modules/indirect.git/blob - t/22-bad-fatal.t
e374a8df8cd0fcf01fd88d2ab182e83b30c0cbf9
[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           '-M-indirect=:fatal',
15           '-c',
16           't/data/bad.d'
17    ];
18
19 plan skip_all => "Couldn't capture buffers" if $success and not defined $stderr;
20 plan tests => 1;
21
22 $stderr = join '', @$stderr;
23 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');