Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make TAP output more strict
The details of how to escape certain sequences in TAP aren't well
specified, but this is what I consider the only sensible thing.
  • Loading branch information
Leont committed Dec 29, 2015
1 parent 461e635 commit 3c42799
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Test.pm6
Expand Up @@ -488,7 +488,7 @@ sub eval_exception($code) {
$!;
}

sub proclaim($cond, $desc) {
sub proclaim($cond, $desc is copy) {
_init_io() unless $output;
# exclude the time spent in proclaim from the test time
$num_of_tests_run = $num_of_tests_run + 1;
Expand All @@ -500,9 +500,10 @@ sub proclaim($cond, $desc) {
$num_of_tests_failed = $num_of_tests_failed + 1
}
}
$desc.=subst(/<[\\\#]>/, { "\\$_" }, :g) ;
if $todo_reason and $num_of_tests_run <= $todo_upto_test_num {
# TAP parsers do not like '#' in the description, they'd miss the '# TODO'
$tap ~= "ok $num_of_tests_run - " ~ $desc.subst('#', '', :g) ~ $todo_reason;
$tap ~= "ok $num_of_tests_run - $desc $todo_reason";
}
else {
$tap ~= "ok $num_of_tests_run - $desc";
Expand Down

0 comments on commit 3c42799

Please sign in to comment.