Skip to content

Commit

Permalink
diag() received output when Callable test fails
Browse files Browse the repository at this point in the history
Otherwise we can't see why exactly it failed
  • Loading branch information
zoffixznet committed Oct 8, 2017
1 parent 71a0ad5 commit 2f0bb20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/packages/Test/Helpers.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sub is-run-repl ($code is copy, $desc, :$out = '', :$err = '') is export {
my $test-name = 'stdout is correct';
when Str { is $output, $_, $test-name; }
when Regex { like $output, $_, $test-name; }
when Callable { ok $_($output), $test-name; }
when Callable { ok $_($output), $test-name or diag $output; }
when Positional { is $output, .join("\n")~"\n", $test-name; }

die "Don't know how to handle :out of type $_.^name()";
Expand All @@ -51,7 +51,7 @@ sub is-run-repl ($code is copy, $desc, :$out = '', :$err = '') is export {
my $test-name = 'stderr is correct';
when Str { is $output, $_, $test-name; }
when Regex { like $output, $_, $test-name; }
when Callable { ok $_($output), $test-name; }
when Callable { ok $_($output), $test-name or diag $output; }
when Positional { is $output, .join("\n")~"\n", $test-name; }

die "Don't know how to handle :err of type $_.^name()";
Expand Down

0 comments on commit 2f0bb20

Please sign in to comment.