]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/42-stress.t
Add a stress test
[perl/modules/indirect.git] / t / 42-stress.t
diff --git a/t/42-stress.t b/t/42-stress.t
new file mode 100644 (file)
index 0000000..bb31787
--- /dev/null
@@ -0,0 +1,23 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+my $count;
+BEGIN { $count = 1_000 }
+
+use Test::More tests => 2 * $count;
+
+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 $_";
+}