]> git.vpit.fr Git - perl/modules/indirect.git/blob - t/22-bad-fatal.t
Importing indirect-0.01.tar.gz
[perl/modules/indirect.git] / t / 22-bad-fatal.t
1 #!perl
2
3 use strict;
4 use warnings;
5
6 my $total;
7 BEGIN {
8  $total = 20;
9 }
10
11 use Test::More tests => 1;
12
13 use IPC::Cmd qw/run/;
14
15 (my $success, my $err_code, undef, undef, my $stderr)
16  = run command => [
17           $^X,
18           map('-I' . $_, @INC),
19           '-M-indirect=:fatal',
20           '-c',
21           't/data/bad.d'
22    ];
23
24 $stderr = join "\n", @$stderr if ref $stderr eq 'ARRAY';
25 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');