]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - t/59-yield-threads.t
Harden t/59-yield-threads.t against stray exits
[perl/modules/Scope-Upper.git] / t / 59-yield-threads.t
index 736388e1f674516628ecc55e6f0e5b48ade100bc..26baf502b3b4b4ab1a03d87cea868118e0397ffd 100644 (file)
@@ -38,12 +38,17 @@ sub up1 {
  );
 
  is_deeply \@res, [ -1, $tid .. $tid + 2, -2 ], "$p: yielded 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);