7 use VPIT::TestHelpers (
8 threads => [ 'Lexical::Types' => 'Lexical::Types::LT_THREADSAFE()' ],
17 package Lexical::Types::Test::Tag;
20 my $tid = threads->tid();
21 my ($file, $line) = (caller(0))[1, 2];
22 my $where = "at $file line $line in thread $tid";
23 local $Test::Builder::Level = $Test::Builder::Level + 1;
24 Test::Leaner::is($_[0], __PACKAGE__, "base type is correct $where");
25 Test::Leaner::is($_[2], 'Tag', "original type is correct $where");
33 use Lexical::Types as => 'Lexical::Types::Test::';
36 my $tid = threads->tid();
40 is $t, $tid, "typed lexical correctly initialized at run $_ in thread $tid";
43 use Lexical::Types as => "Lexical::Types::Test::";
45 is $t2, $tid, "typed lexical correctly initialized in eval at run $_ in thread $tid";
51 skip 'Hints aren\'t propagated into eval STRING below perl 5.10' => 3
55 is $t3, $tid, "typed lexical correctly initialized in eval (propagated) at run $_ in thread $tid"
61 my @t = map spawn(\&try), 1 .. $threads;