From: Vincent Pit Date: Tue, 7 Jul 2009 23:11:28 +0000 (+0200) Subject: Add a stress test X-Git-Tag: v0.15~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=commitdiff_plain;h=a563bfdf922825ad97cb71f5498d5f038cacd9d2;hp=eb4b05d5ad6eec232107b4688e59685bc54f7a65 Add a stress test --- diff --git a/MANIFEST b/MANIFEST index 512c163..a07400d 100644 --- 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 index 0000000..bb31787 --- /dev/null +++ b/t/42-stress.t @@ -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 $_"; +}