7 use Lexical::Types::TestThreads;
9 use Test::More 'no_plan';
15 package Lexical::Types::Test::Tag;
18 my $tid = threads->tid();
19 my ($file, $line) = (caller(0))[1, 2];
20 my $where = "at $file line $line in thread $tid";
21 local $Test::Builder::Level = $Test::Builder::Level + 1;
22 Test::More::is($_[0], __PACKAGE__, "base type is correct $where");
23 Test::More::is($_[2], 'Tag', "original type is correct $where");
31 use Lexical::Types as => 'Lexical::Types::Test::';
34 my $tid = threads->tid();
38 is $t, $tid, "typed lexical correctly initialized at run $_ in thread $tid";
41 use Lexical::Types as => "Lexical::Types::Test::";
43 is $t2, $tid, "typed lexical correctly initialized in eval at run $_ in thread $tid";
49 skip 'Hints aren\'t propagated into eval STRING below perl 5.10' => 3
53 is $t3, $tid, "typed lexical correctly initialized in eval (propagated) at run $_ in thread $tid"
59 my @t = map spawn(\&try), 1 .. $threads;