]> git.vpit.fr Git - perl/modules/indirect.git/commitdiff
Add a stress test
authorVincent Pit <vince@profvince.com>
Tue, 7 Jul 2009 23:11:28 +0000 (01:11 +0200)
committerVincent Pit <vince@profvince.com>
Tue, 7 Jul 2009 23:11:28 +0000 (01:11 +0200)
MANIFEST
t/42-stress.t [new file with mode: 0644]

index 512c163f401e261f071aa507cbd2fb8f511fe610..a07400dedee018b087e444558a19f435f130dcce 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -16,6 +16,7 @@ t/22-bad-mixed.t
 t/30-scope.t
 t/40-threads.t
 t/41-memory.t
+t/42-stress.t
 t/91-pod.t
 t/92-pod-coverage.t
 t/95-portability-files.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 $_";
+}