6 use Scope::Upper qw<uid validate_uid UP HERE>;
9 use VPIT::TestHelpers (
10 threads => [ 'Scope::Upper' => Scope::Upper::SU_THREADSAFE ],
19 my $tid = threads->tid();
25 is uid(UP), $here, "uid(UP) == \$here in block (in thread $tid)";
28 is uid(UP), $top, "uid(UP) == \$top (in thread $tid)";
32 ok validate_uid($here), "\$here is valid (in thread $tid)";
33 ok !validate_uid($up), "\$up is no longer valid (in thread $tid)";
40 for my $thread (map threads->create(\&cb), 1 .. 30) {
42 my $tid = $thread->tid;
43 my $uid = $thread->join;
45 ok !validate_uid($uid), "\$here is no longer valid (out of thread $tid)";
48 is scalar(keys %uids), $threads, 'all the UIDs were different';
50 done_testing($threads * 5 + 1);