X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FThread-Cleanup.git;a=blobdiff_plain;f=t%2F11-detach.t;h=32339aed251d7deef0323c1441d54627d7130146;hp=3c641666c96a5ca6845380ff3461b5627a87d95c;hb=4c809697b9f79c6f752911f19642becfdff2dd87;hpb=e1c6e7a667bb4f5cc0225b126f2b99bdd8f8c5fc diff --git a/t/11-detach.t b/t/11-detach.t index 3c64166..32339ae 100644 --- a/t/11-detach.t +++ b/t/11-detach.t @@ -16,7 +16,7 @@ BEGIN { use threads; use threads::shared; -use Test::More tests => 5 * (2 + 2) + 1; +use Test::More tests => 5 * (2 + 2 + 1) + 1; use Thread::Cleanup; @@ -80,8 +80,12 @@ 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; }