X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F30-threads.t;fp=t%2F30-threads.t;h=5c4b8d1710a3f587a552b6f3e1d8dfa404bf3edc;hb=311cc872692b73075296805143f6a2d8c4074254;hp=32bdf8039ae3205f903d791496204cd65c05ad05;hpb=f04f835b21c960f5a1021bccdd8b5a400159433a;p=perl%2Fmodules%2FLexical-Types.git diff --git a/t/30-threads.t b/t/30-threads.t index 32bdf80..5c4b8d1 100644 --- a/t/30-threads.t +++ b/t/30-threads.t @@ -15,15 +15,17 @@ BEGIN { use threads; -use Test::More tests => 10 * 2 * (1 + 2); +use Test::More tests => 10 * 2 * 2 * (1 + 2); { package Lexical::Types::Test::Tag; sub TYPEDSCALAR { my $tid = threads->tid(); - Test::More::is($_[0], __PACKAGE__, "base type is correct in thread $tid"); - Test::More::is($_[2], 'Tag', "original type is correct in thread $tid"); + my ($file, $line) = (caller(0))[1, 2]; + my $where = "at $file line $line in thread $tid"; + Test::More::is($_[0], __PACKAGE__, "base type is correct $where"); + Test::More::is($_[2], 'Tag', "original type is correct $where"); $_[1] = $tid; (); } @@ -34,10 +36,18 @@ use Test::More tests => 10 * 2 * (1 + 2); use Lexical::Types as => 'Lexical::Types::Test::'; sub try { + my $tid = threads->tid(); + for (1 .. 2) { my Tag $t; - my $tid = threads->tid(); is $t, $tid, "typed lexical correctly initialized at run $_ in thread $tid"; + + eval <<'EVALD'; + use Lexical::Types as => "Lexical::Types::Test::"; + my Tag $t2; + is $t2, $tid, "typed lexical correctly initialized in eval at run $_ in thread $tid"; +EVALD + diag $@ if $@; } }