7 use Scope::Upper::TestThreads;
11 use Scope::Upper qw<uid validate_uid UP HERE>;
16 my $tid = threads->tid();
22 is uid(UP), $here, "uid(UP) == \$here in block (in thread $tid)";
25 is uid(UP), $top, "uid(UP) == \$top (in thread $tid)";
29 ok validate_uid($here), "\$here is valid (in thread $tid)";
30 ok !validate_uid($up), "\$up is no longer valid (in thread $tid)";
37 for my $thread (map threads->create(\&cb), 1 .. 30) {
39 my $tid = $thread->tid;
40 my $uid = $thread->join;
42 ok !validate_uid($uid), "\$here is no longer valid (out of thread $tid)";
45 is scalar(keys %uids), $threads, 'all the UIDs were different';
47 done_testing($threads * 5 + 1);