6 use Test::More tests => 3 * 4;
8 BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} }
11 my ($pkg, $line) = @_;
12 return qr/^Indirect\s+call\s+of\s+method\s+"new"\s+on\s+object\s+"$pkg"\s+at\s+\(eval\s+\d+\)\s+line\s+$line/;
21 my ($code, $lines) = split /#+/, $_, 2;
22 $lines = eval "[ sort ($lines) ]";
24 diag "Couldn't parse line numbers: $@";
30 local $SIG{__WARN__} = sub { push @warns, "@_" };
31 eval "return; no indirect hook => sub { push \@lines, \$_[3] }; $code";
34 is $@, '', 'did\'t croak';
35 is_deeply \@warns, [ ], 'didn\'t warn';
36 is_deeply [ sort @lines ], $lines, 'correct line numbers';
46 my $x = new X; $x = new X; # 1, 1