]> git.vpit.fr Git - perl/modules/Thread-Cleanup.git/blobdiff - t/11-detach.t
Switch qw delimiters to <>
[perl/modules/Thread-Cleanup.git] / t / 11-detach.t
index 3c641666c96a5ca6845380ff3461b5627a87d95c..ef0b3f87c8ccb0774506eff5a39d2770d4948c19 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Config qw/%Config/;
+use Config qw<%Config>;
 
 BEGIN {
  if (!$Config{useithreads}) {
@@ -16,7 +16,12 @@ BEGIN {
 use threads;
 use threads::shared;
 
-use Test::More tests => 5 * (2 + 2) + 1;
+use Test::More tests => 5 * (2 + 2 + 1) + 1;
+
+BEGIN {
+ defined and diag "Using threads $_"         for $threads::VERSION;
+ defined and diag "Using threads::shared $_" for $threads::shared::VERSION;
+}
 
 use Thread::Cleanup;
 
@@ -71,17 +76,18 @@ my @t = map {
  $thr;
 } 0 .. 4;
 
-diag "Using threads $threads::VERSION";
-diag "Using threads::shared $threads::shared::VERSION";
-
 $_->detach for @t;
 
 sleep 2;
 
 is $x, -1, '$x in the main thread';
 
-is $ran{$_},    1, "thread $_ was run once" for @tids;
+for (@tids) {
+ is $ran{$_},    1,     "thread $_ was run once";
+ is $called{$_}, undef, "thread $_ destructor wasn't called yet";
+}
 
 END {
- is $called{$_}, 1, "thread $_ destructor was called once" for @tids;
+ is $called{$_}, 1, "thread $_ destructor was called once at END time"
+                                                                      for @tids;
 }