use warnings;
use lib 't/lib';
-use VPIT::TestHelpers;
-use Lexical::Types::TestThreads;
+use VPIT::TestHelpers (
+ threads => [ 'Lexical::Types' => 'Lexical::Types::LT_THREADSAFE()' ],
+ 'run_perl',
+);
-use Test::More tests => 2;
+use Test::Leaner tests => 2;
-{
+SKIP: {
my $status = run_perl <<' RUN';
{ package IntX; package IntY; package IntZ; }
my ($code, @expected);
$code += 256 if $code < 0;
exit $code;
RUN
+ skip RUN_PERL_FAILED() => 1 unless defined $status;
is $status, 0, 'loading the pragma in a thread and using it outside doesn\'t segfault';
}
-{
+SKIP: {
my $status = run_perl <<' RUN';
use threads;
BEGIN { require Lexical::Types; }
})->join;
exit 0;
RUN
+ skip RUN_PERL_FAILED() => 1 unless defined $status;
is $status, 0, 'Lexical::Types can be loaded in eval STRING during global destruction at the end of a thread';
}