From: Vincent Pit Date: Mon, 6 Apr 2015 15:47:40 +0000 (-0300) Subject: Improve diagnostics in t/09-load-threads.t in case of failure X-Git-Tag: v0.35~10 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=d2cd883c29f9c0629c86334291d90531150dccf2;p=perl%2Fmodules%2Findirect.git Improve diagnostics in t/09-load-threads.t in case of failure --- diff --git a/t/09-load-threads.t b/t/09-load-threads.t index 1f000c1..7575b2d 100644 --- a/t/09-load-threads.t +++ b/t/09-load-threads.t @@ -65,11 +65,19 @@ sub is_loaded { my $res = load_test(); + my $expected; if ($affirmative) { - is $res, 1, "$desc: module loaded"; + $expected = 1; + $desc = "$desc: module loaded"; } else { - is $res, 0, "$desc: module not loaded"; + $expected = 0; + $desc = "$desc: module not loaded"; } + + is($res, $expected, $desc) + or diag("Test '$desc' failed: got '$res', expected '$expected'"); + + return; } BEGIN {