tests: Escape newlines in TAP description

This commit is contained in:
Matthew Martin 2018-02-10 13:23:08 -06:00
parent 1f1e629290
commit 7b417be1ce

View File

@ -141,8 +141,8 @@ run_test_internal() {
local -a highlight_zone; highlight_zone=( ${(z)expected_region_highlight[$i]} ) local -a highlight_zone; highlight_zone=( ${(z)expected_region_highlight[$i]} )
local todo= local todo=
integer start=$highlight_zone[1] end=$highlight_zone[2] integer start=$highlight_zone[1] end=$highlight_zone[2]
# Escape # as ♯ since the former is illegal in the 'description' part of TAP output # Escape # as ♯ and newline as ↵ they are illegal in the 'description' part of TAP output
local desc="[$start,$end] «${BUFFER[$start,$end]//'#'/♯}»" local desc="[$start,$end] «${${BUFFER[$start,$end]//'#'/♯}//$'\n'/↵}»"
(( $+highlight_zone[4] )) && todo="# TODO $highlight_zone[4]" (( $+highlight_zone[4] )) && todo="# TODO $highlight_zone[4]"
for j in {$start..$end}; do for j in {$start..$end}; do
if if