Skip to content

Commit

Permalink
Correctly handle test descriptions with new lines in them
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Aug 18, 2017
1 parent 97f9eb7 commit 9303a6e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/Test.pm6
Expand Up @@ -687,11 +687,10 @@ sub proclaim(Bool(Mu) $cond, $desc is copy ) {
# TAP parsers do not like '#' in the description, they'd miss the '# TODO'
# So, adding a ' \' before it.
$desc = $desc
?? nqp::join(' \\#',
nqp::split('#',
$desc.Str
)
)
?? nqp::join("\n$indents# ", # prefix newlines with `#`
nqp::split("\n",
nqp::join(' \\#', # escape `#`
nqp::split('#', $desc.Str))))
!! '';

$tap ~= $todo_reason && $num_of_tests_run <= $todo_upto_test_num
Expand Down

0 comments on commit 9303a6e

Please sign in to comment.