From: Vincent Pit Date: Wed, 15 Jul 2009 17:09:08 +0000 (+0200) Subject: Freshen t/40-threads.t X-Git-Tag: v0.17~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=commitdiff_plain;h=46a10a703930cdad32d1fc76791760434a441eec;hp=94aa495eddd4c48c51cebabae453a4b3ce7c0ab2 Freshen t/40-threads.t --- diff --git a/t/40-threads.t b/t/40-threads.t index ce8ff03..0bae40a 100644 --- a/t/40-threads.t +++ b/t/40-threads.t @@ -29,7 +29,7 @@ BEGIN { sub expect { my ($pkg) = @_; - return qr/^Indirect\s+call\s+of\s+method\s+"new"\s+on\s+object\s+"$pkg"\s+at\s+\(eval\s+\d+\)\s+line\s+\d+/; + qr/^Indirect call of method "new" on object "$pkg" at \(eval \d+\) line \d+/; } { @@ -43,7 +43,7 @@ sub expect { my $class = "Coconut$tid"; my @warns; { - local $SIG{__WARN__} = sub { push @warns, "@_" }; + local $SIG{__WARN__} = sub { push @warns, @_ }; eval 'die "the code compiled but it shouldn\'t have\n"; no indirect ":fatal"; my $x = new ' . $class . ' 1, 2;'; } @@ -60,10 +60,11 @@ SKIP: my $class = "Pineapple$tid"; my @warns; { - local $SIG{__WARN__} = sub { push @warns, "@_" }; - eval 'die "ok\n"; my $y = new ' . $class . ' 1, 2;'; + local $SIG{__WARN__} = sub { push @warns, @_ }; + eval 'return; my $y = new ' . $class . ' 1, 2;'; } - is $@, "ok\n", + is $@, '', + "\"no indirect\" propagated into eval in thread $tid didn't croak"; my $first = shift @warns; like $first || '', expect($class), "\"no indirect\" propagated into eval in thread $tid warned once";