X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F40-threads.t;h=16af4ca9656a0a72f282e39d71ca33b07961a7e9;hp=ce8ff03d9b4ce454a2186688ea8f273080a9058d;hb=4168177ad46806cfb9e0cdb522aed997215cf8b2;hpb=cfbd22399e253cbac1aad5436d2b191082befe14 diff --git a/t/40-threads.t b/t/40-threads.t index ce8ff03..16af4ca 100644 --- a/t/40-threads.t +++ b/t/40-threads.t @@ -18,6 +18,7 @@ use threads; use Test::More; BEGIN { + delete $ENV{PERL_INDIRECT_PM_DISABLE}; require indirect; if (indirect::I_THREADSAFE()) { plan tests => 10 * 2 * (2 + 3); @@ -29,7 +30,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 +44,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 +61,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";