From 498cc7641f360bc84b9ae92630b0609ae1976ee2 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 15 Mar 2020 14:34:25 +0000 Subject: [PATCH] tests: Extend and document the after-a-parse-error aspects of the issue #651 test. --- highlighters/main/test-data/array-cmdsep1.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/highlighters/main/test-data/array-cmdsep1.zsh b/highlighters/main/test-data/array-cmdsep1.zsh index 3ffe43d..790c030 100644 --- a/highlighters/main/test-data/array-cmdsep1.zsh +++ b/highlighters/main/test-data/array-cmdsep1.zsh @@ -29,11 +29,16 @@ # ------------------------------------------------------------------------------------------------- BUFFER=$'a=( foo | bar )' +bar(){} expected_region_highlight=( '1 3 assign' # a=( '5 7 default' # foo '9 9 unknown-token' # | - '11 13 unknown-token' # bar + # zsh reports a parse error at this point. Nevertheless, we test how we + # highlight the remainder of $BUFFER. Currently we recover by treating the pipe + # as a command separator. That's not the only reasonable behaviour, though; if + # we change the behaviour, we should adjust the following expectations accordingly. + '11 13 function' # bar '15 15 unknown-token' # ) )