Skip to content

Commit

Permalink
Fix "diag "foo"|"bar"
Browse files Browse the repository at this point in the history
We allow junctions to be specified in e.g. "is", but if they fail, they
used to bomb on the "diag" being done.  This fixes the bombing.   This is
spectests clean.

Inspired by Text::CSV ecosystem fallout, following hash randomization changes
needing tests to be fixed.
  • Loading branch information
lizmat committed Jul 4, 2018
1 parent 2a414ae commit 5ec2c96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Test.pm6
Expand Up @@ -423,14 +423,14 @@ multi sub subtest(&subtests, $desc = '') is export {
proclaim($status,$desc) or ($die_on_fail and die-on-fail);
}

sub diag(Mu $message) is export {
sub diag($message) is export {
# Always send user-triggered diagnostics to STDERR. This prevents
# cases of confusion of where diag() has to send its ouput when
# we are in the middle of TODO tests
_diag $message, :force-stderr;
}

sub _diag(Mu $message, :$force-stderr) {
sub _diag($message, :$force-stderr) {
_init_io() unless $output;
my $is_todo = !$force-stderr
&& ($subtest_todo_reason || $num_of_tests_run <= $todo_upto_test_num);
Expand Down

1 comment on commit 5ec2c96

@Tux
Copy link

@Tux Tux commented on 5ec2c96 Jul 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Thanks!

Please sign in to comment.