From 3e7745ef30fb5d51b0f6fc81814e9c10beb3b73e Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 19 Mar 2020 19:15:21 +0000 Subject: [PATCH] test harness: Stringify values in a more readable manner. (q-) passes through newlines and NUL bytes verbatim. Using (qqqq) ensures the escaped string will be on a single line (as required by the TAP format) and be readable even if it contains control characters. --- tests/test-highlighting.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index 6b83dbf..e03287f 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -95,9 +95,9 @@ ZSH_HIGHLIGHT_HIGHLIGHTERS=($1) typeset_p() { for 1 ; do if [[ ${(tP)1} == *array* ]]; then - print -r -- "$1=( ${(@q-P)1} )" + print -r -- "$1=( ${(@qqqqP)1} )" else - print -r -- "$1=${(q-P)1}" + print -r -- "$1=${(qqqqP)1}" fi done }