]> git.vpit.fr Git - perl/modules/indirect.git/blob - t/42-stress.t
Only enable the pragma during compile time
[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 for (1 .. $count) {
12  my @errs;
13  {
14   local $SIG{__WARN__} = sub { die @_ };
15   eval q(
16    return;
17    no indirect hook => sub { push @errs, [ @_[0, 1, 3] ] };
18    my $x = new Wut;
19   );
20  }
21  is        $@,     '',                      "didn't croak at run $_";
22  is_deeply \@errs, [ [ 'Wut', 'new', 4 ] ], "got the right data at run $_";
23 }