-
-
Save AlexDaniel/1878b6ab1eddc568b6f8e78a7618769d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
use Test; | |
plan 2; | |
sub group-of ( | |
Pair ( | |
Int:D :key($plan), | |
Pair :value(( | |
Str:D :key($desc), | |
:value(&tests)))) | |
) is export { | |
subtest $desc => { | |
plan $plan; | |
tests | |
} | |
} | |
# RT#128098 | |
{ | |
my $proc = run :out, :err, $*EXECUTABLE, '-e', | |
q/use Test; plan 1; diag 'test message'; ok 1;/; | |
group-of 2 => 'diag at the start of file shows up in non-verbose prove run' => { | |
like $proc.out.slurp-rest, /^ '1..1' \s+ 'ok 1 -' \s* $/, 'STDOUT'; | |
like $proc.err.slurp-rest, /'test message'/, 'STDERR'; | |
} | |
} | |
{ | |
my $proc = run :out, :err, $*EXECUTABLE, '-e', | |
q/use Test; plan 1; todo 'meow'; diag 'test message'; ok 1;/; | |
group-of 3 => 'using diag in the middle of TODO tests does not interfere' => { | |
my $out = $proc.out.slurp-rest; | |
like $out, /^ '1..1' \s+ 'ok 1 -' \s* '# TODO'/, 'STDOUT has TODO'; | |
unlike $out, /'test message'/, 'diag message is not in STDOUT'; | |
like $proc.err.slurp-rest, /'test message'/, | |
'diag message is in STDERR'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment