]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/46-stress.t
Make some room in t/4*.t
[perl/modules/indirect.git] / t / 46-stress.t
diff --git a/t/46-stress.t b/t/46-stress.t
new file mode 100644 (file)
index 0000000..cf474a8
--- /dev/null
@@ -0,0 +1,25 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+my $count;
+BEGIN { $count = 1_000 }
+
+use Test::More tests => 2 * $count;
+
+BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} }
+
+for (1 .. $count) {
+ my @errs;
+ {
+  local $SIG{__WARN__} = sub { die @_ };
+  eval q(
+   return;
+   no indirect hook => sub { push @errs, [ @_[0, 1, 3] ] };
+   my $x = new Wut;
+  );
+ }
+ is        $@,     '',                      "didn't croak at run $_";
+ is_deeply \@errs, [ [ 'Wut', 'new', 4 ] ], "got the right data at run $_";
+}