]> git.vpit.fr Git - perl/modules/indirect.git/blob - t/42-stress.t
c07766a234204d78a80b6d75534e03ae3465b6f3 is a better fix for RT #47902 than 4cb0e2cc2...
[perl/modules/indirect.git] / t / 42-stress.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 my $count;
7 BEGIN { $count = 1_000 }
8
9 use Test::More tests => 2 * $count;
10
11 BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} }
12
13 for (1 .. $count) {
14  my @errs;
15  {
16   local $SIG{__WARN__} = sub { die @_ };
17   eval q(
18    return;
19    no indirect hook => sub { push @errs, [ @_[0, 1, 3] ] };
20    my $x = new Wut;
21   );
22  }
23  is        $@,     '',                      "didn't croak at run $_";
24  is_deeply \@errs, [ [ 'Wut', 'new', 4 ] ], "got the right data at run $_";
25 }