From: Vincent Pit Date: Mon, 6 Apr 2015 17:11:10 +0000 (-0300) Subject: Handle undef properly for failure diagnostics in t/09-load-threads.t X-Git-Tag: v0.35~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=831f88dd7f6372e1a1f01db13f4c288fef0e2619;p=perl%2Fmodules%2Findirect.git Handle undef properly for failure diagnostics in t/09-load-threads.t --- diff --git a/t/09-load-threads.t b/t/09-load-threads.t index 4652ab9..673f5cf 100644 --- a/t/09-load-threads.t +++ b/t/09-load-threads.t @@ -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; }