]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Reuse the diag() helper in the TestThreads module
authorVincent Pit <vince@profvince.com>
Sun, 6 May 2012 13:16:42 +0000 (15:16 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 6 May 2012 13:16:42 +0000 (15:16 +0200)
t/lib/Variable/Magic/TestThreads.pm

index a846a5abf587fdd71b5e51ef3fda52caf86e93e7..4a18667a0487715712d0fe175cb25f8c6bb659b5 100644 (file)
@@ -15,7 +15,7 @@ sub skipall {
 
 sub diag {
  require Test::More;
- Test::More::diag(@_);
+ Test::More::diag($_) for @_;
 }
 
 sub import {
@@ -66,10 +66,7 @@ sub spawn {
   threads->create(@_);
  };
  push @diag, "Thread creation error: $@" if $@;
- if (@diag) {
-  require Test::More;
-  Test::More::diag($_) for @diag;
- }
+ diag(@diag) if @diag;
  return $thread ? $thread : ();
 }