12 use Test::More tests => 3 * 9;
14 BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} }
25 local $SIG{__WARN__} = sub { push @warns, @_ };
36 my ($skip, $prefix) = split /#+/, $1;
37 $skip = 0 unless defined $skip;
38 $prefix = '' unless defined $prefix;
43 skip "$_: $skip" => 9 if do { local $@; eval $skip };
49 try "return; $prefix; use indirect; $_";
50 is $@, '', "use indirect: $_";
51 is @warns, 0, 'correct number of reports';
53 try "return; $prefix; no indirect; $_";
54 is $@, '', "no indirect: $_";
55 is @warns, 0, 'correct number of reports';
62 try "return; $prefix; use indirect; $_";
63 is $@, '', "use indirect, defined: $_";
64 is @warns, 0, 'correct number of reports';
66 try "return; $prefix; no indirect; $_";
67 is $@, '', "use indirect, defined: $_";
68 is @warns, 1, 'correct number of reports';
69 like $warns[0], qr/^Indirect call of method "meh" on object "NotEmpty" at \(eval \d+\) line \d+/, 'report 0 is correct';