]> git.vpit.fr Git - perl/modules/indirect.git/commitdiff
Handle undef properly for failure diagnostics in t/09-load-threads.t
authorVincent Pit <vince@profvince.com>
Mon, 6 Apr 2015 17:11:10 +0000 (14:11 -0300)
committerVincent Pit <vince@profvince.com>
Mon, 6 Apr 2015 17:11:10 +0000 (14:11 -0300)
t/09-load-threads.t

index 4652ab9f7d489da70bf7fe3381176df6a0be7904..673f5cf0691641632100ae2e44aa8cadc4ffc905 100644 (file)
@@ -74,8 +74,11 @@ sub is_loaded {
   $desc     = "$desc: module not loaded";
  }
 
- is($res, $expected, $desc)
-               or diag("Test '$desc' failed: got '$res', expected '$expected'");
+ unless (is $res, $expected, $desc) {
+  $res      = defined $res ? "'$res'" : 'undef';
+  $expected = "'$expected'";
+  diag("Test '$desc' failed: got $res, expected $expected");
+ }
 
  return;
 }