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