]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - t/54-unwind-threads.t
Harden t/54-unwind-threads.t against stray exits
[perl/modules/Scope-Upper.git] / t / 54-unwind-threads.t
index af6a3ca4acee5d98460b21d98450595caf4530dd..490e6ad56137d6f5ba69e1b82884316ccb17989f 100644 (file)
@@ -38,12 +38,17 @@ sub up1 {
  );
 
  is_deeply \@res, [ -1, $tid .. $tid + 2, -2 ], "$p: unwinded correctly";
+
+ return 1;
 }
 
 my @threads = map spawn(\&up1), 1 .. 30;
 
-$_->join for @threads;
+my $completed = 0;
+for my $thr (@threads) {
+ ++$completed if $thr->join;
+}
 
 pass 'done';
 
-done_testing(scalar(@threads) + 1);
+done_testing($completed + 1);