From 99389327aef8ea5621c8aef82034e31ee2087e62 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 17 Mar 2020 16:22:56 +0000 Subject: [PATCH] test harness: Fix test failures under zsh 5.0.8 and older. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The output of test-data/opt-shwordsplit1.zsh on zsh 5.7 is: . 1..2 ## opt-shwordsplit1 # BUFFER=vim not ok 1 - [1,7] «$EDITOR» - expected (1 7 "function"), observed (1 7 "unknown-token"). # TODO "issue ok 2 - cardinality check # SKIP cardinality check disabled whilst regular test points are expected to fail On zsh 5.0.8, tap_escape() choked when called on the arguments argv=('[1,7]' '«vim»'). This patch fixes that. As you may have noticed, under zsh 5.7 the diagnostic message of test point 1 is truncated. That'll be fixed in the next commit. --- tests/test-highlighting.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index 9742612..524a765 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -105,7 +105,7 @@ typeset_p() { # Escape # as ♯ and newline as ↵ they are illegal in the 'description' part of TAP output # The string to escape is «"$@"»; the result is returned in $REPLY. tap_escape() { - local s="$@" + local s="${(j. .)@}" REPLY="${${s//'#'/♯}//$'\n'/↵}" }