diff --git a/highlighters/brackets/test-data/mismatch-patentheses.zsh b/highlighters/brackets/test-data/mismatch-patentheses.zsh index b45b868..f0991b0 100644 --- a/highlighters/brackets/test-data/mismatch-patentheses.zsh +++ b/highlighters/brackets/test-data/mismatch-patentheses.zsh @@ -30,8 +30,8 @@ BUFFER='echo ({x}]' expected_region_highlight=( - "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # ( - "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # { - "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # } - "10 10 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # ) + "6 6 bracket-error" # ( + "7 7 bracket-level-2" # { + "9 9 bracket-level-2" # } + "10 10 bracket-error" # ) ) diff --git a/highlighters/brackets/test-data/nested-parentheses.zsh b/highlighters/brackets/test-data/nested-parentheses.zsh index 028aed1..b3f531b 100644 --- a/highlighters/brackets/test-data/nested-parentheses.zsh +++ b/highlighters/brackets/test-data/nested-parentheses.zsh @@ -30,10 +30,10 @@ BUFFER='echo $(echo ${(z)array})' expected_region_highlight=( - "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # ( - "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # { - "15 15 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-3]}" # ( - "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-3]}" # ) - "23 23 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # } - "24 24 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # ) + "7 7 bracket-level-1" # ( + "14 14 bracket-level-2" # { + "15 15 bracket-level-3" # ( + "17 17 bracket-level-3" # ) + "23 23 bracket-level-2" # } + "24 24 bracket-level-1" # ) ) diff --git a/highlighters/brackets/test-data/quoted-patentheses.zsh b/highlighters/brackets/test-data/quoted-patentheses.zsh index 5819180..954445e 100644 --- a/highlighters/brackets/test-data/quoted-patentheses.zsh +++ b/highlighters/brackets/test-data/quoted-patentheses.zsh @@ -30,5 +30,5 @@ BUFFER='echo "foo ( bar"' expected_region_highlight=( -"1 16 ${(q-)ZSH_HIGHLIGHT_STYLES[none]}" # We expect the brackets highlighter to do nothing +"1 16 none" # We expect the brackets highlighter to do nothing ) diff --git a/highlighters/brackets/test-data/simple-parentheses.zsh b/highlighters/brackets/test-data/simple-parentheses.zsh index 8e0c1a3..3fc66df 100644 --- a/highlighters/brackets/test-data/simple-parentheses.zsh +++ b/highlighters/brackets/test-data/simple-parentheses.zsh @@ -30,8 +30,8 @@ BUFFER='echo ({x})' expected_region_highlight=( - "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # ( - "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # { - "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # } - "10 10 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # ) + "6 6 bracket-level-1" # ( + "7 7 bracket-level-2" # { + "9 9 bracket-level-2" # } + "10 10 bracket-level-1" # ) ) diff --git a/highlighters/brackets/test-data/unclosed-patentheses.zsh b/highlighters/brackets/test-data/unclosed-patentheses.zsh index 4edfc46..e1a634a 100644 --- a/highlighters/brackets/test-data/unclosed-patentheses.zsh +++ b/highlighters/brackets/test-data/unclosed-patentheses.zsh @@ -30,7 +30,7 @@ BUFFER='echo ({x}' expected_region_highlight=( - "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # ( - "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # { - "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # } + "6 6 bracket-error" # ( + "7 7 bracket-level-2" # { + "9 9 bracket-level-2" # } ) diff --git a/highlighters/brackets/test-data/unclosed-patentheses2.zsh b/highlighters/brackets/test-data/unclosed-patentheses2.zsh index 15c7fbe..1a1937f 100644 --- a/highlighters/brackets/test-data/unclosed-patentheses2.zsh +++ b/highlighters/brackets/test-data/unclosed-patentheses2.zsh @@ -30,7 +30,7 @@ BUFFER='echo {x})' expected_region_highlight=( - "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # { - "8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # } - "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # ) + "6 6 bracket-level-1" # { + "8 8 bracket-level-1" # } + "9 9 bracket-error" # ) ) diff --git a/highlighters/main/test-data/alias-assignment1.zsh b/highlighters/main/test-data/alias-assignment1.zsh index 435b72d..3cdf4e6 100644 --- a/highlighters/main/test-data/alias-assignment1.zsh +++ b/highlighters/main/test-data/alias-assignment1.zsh @@ -34,5 +34,5 @@ ZSH_HIGHLIGHT_STYLES[alias]=$unused_highlight BUFFER='x=y ls' expected_region_highlight=( - "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # x=y + "1 3 unknown-token" # x=y ) diff --git a/highlighters/main/test-data/alias.zsh b/highlighters/main/test-data/alias.zsh index ea804fa..344f0de 100644 --- a/highlighters/main/test-data/alias.zsh +++ b/highlighters/main/test-data/alias.zsh @@ -43,9 +43,9 @@ BUFFER='x.alias2; alias1' expected_region_highlight=() if [[ "$(type -w x.alias2)" == *suffix* ]]; then expected_region_highlight+=( - "1 8 ${(q-)ZSH_HIGHLIGHT_STYLES[suffix-alias]}" # x.alias2 + "1 8 suffix-alias" # x.alias2 ) fi expected_region_highlight+=( - "11 16 ${(q-)ZSH_HIGHLIGHT_STYLES[alias]}" # alias1 + "11 16 alias" # alias1 ) diff --git a/highlighters/main/test-data/anonymous-function.zsh b/highlighters/main/test-data/anonymous-function.zsh index e301a66..a6fbcf0 100644 --- a/highlighters/main/test-data/anonymous-function.zsh +++ b/highlighters/main/test-data/anonymous-function.zsh @@ -30,11 +30,11 @@ BUFFER='() echo hello; () { echo world }' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # () - "4 7 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo - "9 13 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # hello - "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; - "16 17 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # () - "19 19 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # { - "21 24 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo + "1 2 reserved-word" # () + "4 7 builtin" # echo + "9 13 default" # hello + "14 14 commandseparator" # ; + "16 17 reserved-word" # () + "19 19 reserved-word" # { + "21 24 builtin" # echo ) diff --git a/highlighters/main/test-data/arithmetic-evaluation.zsh b/highlighters/main/test-data/arithmetic-evaluation.zsh index e5caaa8..e0eb6e7 100644 --- a/highlighters/main/test-data/arithmetic-evaluation.zsh +++ b/highlighters/main/test-data/arithmetic-evaluation.zsh @@ -35,6 +35,6 @@ BUFFER='(( x == 42 ))' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # (( - "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # )) + "1 2 reserved-word" # (( + "12 13 reserved-word" # )) ) diff --git a/highlighters/main/test-data/assign-append.zsh b/highlighters/main/test-data/assign-append.zsh index 094ea3f..82b48f9 100644 --- a/highlighters/main/test-data/assign-append.zsh +++ b/highlighters/main/test-data/assign-append.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER='a+=(lorem ipsum)' expected_region_highlight=( - "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # a+=( + "1 4 assign" # a+=( ) diff --git a/highlighters/main/test-data/assign-array.zsh b/highlighters/main/test-data/assign-array.zsh index 377a4cc..be3f13b 100644 --- a/highlighters/main/test-data/assign-array.zsh +++ b/highlighters/main/test-data/assign-array.zsh @@ -31,8 +31,8 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER='(A=(hello world))' expected_region_highlight=( - "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ( - "2 4 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # A=( - "16 16 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # ) - "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ) + "1 1 reserved-word" # ( + "2 4 assign" # A=( + "16 16 assign" # ) + "17 17 reserved-word" # ) ) diff --git a/highlighters/main/test-data/assign-semicolon.zsh b/highlighters/main/test-data/assign-semicolon.zsh index 9b81195..8fe2964 100644 --- a/highlighters/main/test-data/assign-semicolon.zsh +++ b/highlighters/main/test-data/assign-semicolon.zsh @@ -31,6 +31,6 @@ ZSH_HIGHLIGHT_STYLES[commandseparator]=$unused_highlight BUFFER='A=1; echo hello world' expected_region_highlight=( - "4 4 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; - "6 9 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo + "4 4 commandseparator" # ; + "6 9 builtin" # echo ) diff --git a/highlighters/main/test-data/assign-subshell.zsh b/highlighters/main/test-data/assign-subshell.zsh index 784c968..f9639fe 100644 --- a/highlighters/main/test-data/assign-subshell.zsh +++ b/highlighters/main/test-data/assign-subshell.zsh @@ -31,7 +31,7 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER='(A=1)' expected_region_highlight=( - "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ( - "2 4 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # A=1 - "5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]} 'issue #231'" # ) + "1 1 reserved-word" # ( + "2 4 assign" # A=1 + "5 5 reserved-word 'issue #231'" # ) ) diff --git a/highlighters/main/test-data/assign.zsh b/highlighters/main/test-data/assign.zsh index 443fff8..9148d52 100644 --- a/highlighters/main/test-data/assign.zsh +++ b/highlighters/main/test-data/assign.zsh @@ -31,8 +31,8 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER='A=1 b=("foo" bar)' expected_region_highlight=( - "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # A=1 - "5 7 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # b=( - "8 12 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo" - "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # ) + "1 3 assign" # A=1 + "5 7 assign" # b=( + "8 12 double-quoted-argument" # "foo" + "17 17 assign" # ) ) diff --git a/highlighters/main/test-data/back-quoted-argument.zsh b/highlighters/main/test-data/back-quoted-argument.zsh index cb182b5..cd73212 100644 --- a/highlighters/main/test-data/back-quoted-argument.zsh +++ b/highlighters/main/test-data/back-quoted-argument.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=$unused_highlight BUFFER='echo `echo 42`' expected_region_highlight=( - "6 14 ${(q-)ZSH_HIGHLIGHT_STYLES[back-quoted-argument]}" + "6 14 back-quoted-argument" ) diff --git a/highlighters/main/test-data/backslash-continuation.zsh b/highlighters/main/test-data/backslash-continuation.zsh index e1fd1d3..ebcf2e1 100644 --- a/highlighters/main/test-data/backslash-continuation.zsh +++ b/highlighters/main/test-data/backslash-continuation.zsh @@ -31,5 +31,5 @@ PREBUFFER=$'echo \\\n' BUFFER='noglob' expected_region_highlight=( - "1 6 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # 'noglob' highlighted as a string, not as a precomand + "1 6 default" # 'noglob' highlighted as a string, not as a precomand ) diff --git a/highlighters/main/test-data/commandseparator.zsh b/highlighters/main/test-data/commandseparator.zsh index 1f66f3f..e478318 100644 --- a/highlighters/main/test-data/commandseparator.zsh +++ b/highlighters/main/test-data/commandseparator.zsh @@ -32,8 +32,8 @@ ZSH_HIGHLIGHT_STYLES[commandseparator]=$unused_highlight BUFFER=':; pwd &! ls' expected_region_highlight=( - "2 2 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; - "4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # pwd - "8 9 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # &! - "11 12 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "2 2 commandseparator" # ; + "4 6 builtin" # pwd + "8 9 commandseparator" # &! + "11 12 command" # ls ) diff --git a/highlighters/main/test-data/comment-leading.zsh b/highlighters/main/test-data/comment-leading.zsh index d5ccdfd..f750cc4 100644 --- a/highlighters/main/test-data/comment-leading.zsh +++ b/highlighters/main/test-data/comment-leading.zsh @@ -32,6 +32,6 @@ setopt interactive_comments BUFFER='# echo foo' expected_region_highlight=( - "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[comment]}" # # - "2 10 ${(q-)ZSH_HIGHLIGHT_STYLES[comment]}" # " echo foo" + "1 1 comment" # # + "2 10 comment" # " echo foo" ) diff --git a/highlighters/main/test-data/comment-off.zsh b/highlighters/main/test-data/comment-off.zsh index a9a346e..0381bdb 100644 --- a/highlighters/main/test-data/comment-off.zsh +++ b/highlighters/main/test-data/comment-off.zsh @@ -32,7 +32,7 @@ unsetopt interactive_comments BUFFER='# echo foo' expected_region_highlight=( - "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # # - "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # " echo foo" - "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # " echo foo" + "1 1 unknown-token" # # + "3 6 default" # " echo foo" + "8 10 default" # " echo foo" ) diff --git a/highlighters/main/test-data/comments.zsh b/highlighters/main/test-data/comments.zsh index 0ef4956..3bb008e 100644 --- a/highlighters/main/test-data/comments.zsh +++ b/highlighters/main/test-data/comments.zsh @@ -32,7 +32,7 @@ setopt interactive_comments BUFFER='echo "foo #bar" #baz # quux' expected_region_highlight=( - "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo - "6 15 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo #bar" - "17 27 ${(q-)ZSH_HIGHLIGHT_STYLES[comment]}" # #baz # quux + "1 4 builtin" # echo + "6 15 double-quoted-argument" # "foo #bar" + "17 27 comment" # #baz # quux ) diff --git a/highlighters/main/test-data/commmand-parameter.zsh b/highlighters/main/test-data/commmand-parameter.zsh index 4cffde7..fb43e9e 100644 --- a/highlighters/main/test-data/commmand-parameter.zsh +++ b/highlighters/main/test-data/commmand-parameter.zsh @@ -31,6 +31,6 @@ x=/usr/bin/env BUFFER='$x "argument"' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # $x - "4 13 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "argument" + "1 2 command" # $x + "4 13 double-quoted-argument" # "argument" ) diff --git a/highlighters/main/test-data/control-flow.zsh b/highlighters/main/test-data/control-flow.zsh index 1de787b..58a696b 100644 --- a/highlighters/main/test-data/control-flow.zsh +++ b/highlighters/main/test-data/control-flow.zsh @@ -31,21 +31,21 @@ ZSH_HIGHLIGHT_STYLES[alias]=$unused_highlight BUFFER='while if echo Hello; then ls /; else ls; fi; do stat "x"; done; repeat 10 ls' expected_region_highlight+=( - "1 5 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # while - "7 8 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # if - "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo - "15 19 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # Hello - "22 25 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # then - "27 28 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "30 30 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # / - "31 31 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; - "33 36 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # else - "38 39 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "42 43 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # fi - "46 47 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # do - "49 52 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # stat - "54 56 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "x" - "59 62 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # done - "65 70 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # repeat - "75 76 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "1 5 reserved-word" # while + "7 8 reserved-word" # if + "10 13 builtin" # echo + "15 19 default" # Hello + "22 25 reserved-word" # then + "27 28 command" # ls + "30 30 path" # / + "31 31 commandseparator" # ; + "33 36 reserved-word" # else + "38 39 command" # ls + "42 43 reserved-word" # fi + "46 47 reserved-word" # do + "49 52 command" # stat + "54 56 double-quoted-argument" # "x" + "59 62 reserved-word" # done + "65 70 reserved-word" # repeat + "75 76 command" # ls ) diff --git a/highlighters/main/test-data/dollar-quoted.zsh b/highlighters/main/test-data/dollar-quoted.zsh index f8ffefa..cfeb6d3 100644 --- a/highlighters/main/test-data/dollar-quoted.zsh +++ b/highlighters/main/test-data/dollar-quoted.zsh @@ -31,6 +31,6 @@ ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]=$unused_highlight BUFFER=": \$'*' 'foo'" expected_region_highlight=( - "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $'*' - not a glob - "8 12 ${(q-)ZSH_HIGHLIGHT_STYLES[single-quoted-argument]}" # 'foo' + "3 6 dollar-quoted-argument" # $'*' - not a glob + "8 12 single-quoted-argument" # 'foo' ) diff --git a/highlighters/main/test-data/dollar-quoted2.zsh b/highlighters/main/test-data/dollar-quoted2.zsh index a29edbb..03afc66 100644 --- a/highlighters/main/test-data/dollar-quoted2.zsh +++ b/highlighters/main/test-data/dollar-quoted2.zsh @@ -31,11 +31,11 @@ ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]=$unused_highlight BUFFER=": \$'foo\xbar\udeadbeef\uzzzz'" expected_region_highlight=( - "3 7 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $'foo - "8 11 ${(q-)ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]}" # \xba - "12 12 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # r - "13 18 ${(q-)ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]}" # \dead - "19 22 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # beef - "23 24 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # \u - "25 29 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # zzzz' + "3 7 dollar-quoted-argument" # $'foo + "8 11 back-dollar-quoted-argument" # \xba + "12 12 dollar-quoted-argument" # r + "13 18 back-dollar-quoted-argument" # \dead + "19 22 dollar-quoted-argument" # beef + "23 24 unknown-token" # \u + "25 29 dollar-quoted-argument" # zzzz' ) diff --git a/highlighters/main/test-data/dollar-quoted3.zsh b/highlighters/main/test-data/dollar-quoted3.zsh index eb1ee82..cb5bd77 100644 --- a/highlighters/main/test-data/dollar-quoted3.zsh +++ b/highlighters/main/test-data/dollar-quoted3.zsh @@ -33,6 +33,6 @@ ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]=$unused_highlight BUFFER=": \$'\xa1" expected_region_highlight=( - "3 4 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $' - "5 8 ${(q-)ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]}" # \xa1 + "3 4 dollar-quoted-argument" # $' + "5 8 back-dollar-quoted-argument" # \xa1 ) diff --git a/highlighters/main/test-data/double-hyphen-option.zsh b/highlighters/main/test-data/double-hyphen-option.zsh index eb7514f..3339d89 100644 --- a/highlighters/main/test-data/double-hyphen-option.zsh +++ b/highlighters/main/test-data/double-hyphen-option.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=$unused_highlight BUFFER='hello --world' expected_region_highlight=( - "7 13 ${(q-)ZSH_HIGHLIGHT_STYLES[double-hyphen-option]}" # --world + "7 13 double-hyphen-option" # --world ) diff --git a/highlighters/main/test-data/double-quoted.zsh b/highlighters/main/test-data/double-quoted.zsh index ececcca..7e379f8 100644 --- a/highlighters/main/test-data/double-quoted.zsh +++ b/highlighters/main/test-data/double-quoted.zsh @@ -31,15 +31,15 @@ BUFFER=': "foo$bar:\`:\":\$:' BUFFER+=\\\\:\" expected_region_highlight=( - "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo - "7 10 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # $bar - "11 11 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # : - "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \` - "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # : - "15 16 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \$ - "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # : - "18 19 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \" - "20 20 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # : - "21 22 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \\ - "23 24 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # :" + "3 6 double-quoted-argument" # "foo + "7 10 dollar-double-quoted-argument" # $bar + "11 11 double-quoted-argument" # : + "12 13 back-double-quoted-argument" # \` + "14 14 double-quoted-argument" # : + "15 16 back-double-quoted-argument" # \$ + "17 17 double-quoted-argument" # : + "18 19 back-double-quoted-argument" # \" + "20 20 double-quoted-argument" # : + "21 22 back-double-quoted-argument" # \\ + "23 24 double-quoted-argument" # :" ) diff --git a/highlighters/main/test-data/double-quoted2.zsh b/highlighters/main/test-data/double-quoted2.zsh index dcae235..1538423 100644 --- a/highlighters/main/test-data/double-quoted2.zsh +++ b/highlighters/main/test-data/double-quoted2.zsh @@ -32,6 +32,6 @@ BUFFER=': "foo$bar' expected_region_highlight=( - "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo - "7 10 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # $bar + "3 6 double-quoted-argument" # "foo + "7 10 dollar-double-quoted-argument" # $bar ) diff --git a/highlighters/main/test-data/double-quoted3.zsh b/highlighters/main/test-data/double-quoted3.zsh index efbcd63..39514e0 100644 --- a/highlighters/main/test-data/double-quoted3.zsh +++ b/highlighters/main/test-data/double-quoted3.zsh @@ -31,9 +31,9 @@ BUFFER=': "$" "$42foo"' BUFFER+=\ \"\\\'\\x\" expected_region_highlight=( - "3 5 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "$" - "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # " - "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # $42 - "11 14 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # foo" - "16 21 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "\'\x" - \' and \x are not escape sequences + "3 5 double-quoted-argument" # "$" + "7 7 double-quoted-argument" # " + "8 10 dollar-double-quoted-argument" # $42 + "11 14 double-quoted-argument" # foo" + "16 21 double-quoted-argument" # "\'\x" - \' and \x are not escape sequences ) diff --git a/highlighters/main/test-data/double-quoted4.zsh b/highlighters/main/test-data/double-quoted4.zsh index 4a1e205..51bb25e 100644 --- a/highlighters/main/test-data/double-quoted4.zsh +++ b/highlighters/main/test-data/double-quoted4.zsh @@ -30,7 +30,7 @@ BUFFER=': "${foo}bar"' expected_region_highlight=( - "3 3 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # " - "4 9 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # ${foo} - "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # bar" + "3 3 double-quoted-argument" # " + "4 9 dollar-double-quoted-argument" # ${foo} + "10 13 double-quoted-argument" # bar" ) diff --git a/highlighters/main/test-data/empty-command.zsh b/highlighters/main/test-data/empty-command.zsh index 4da62ba..6e68184 100644 --- a/highlighters/main/test-data/empty-command.zsh +++ b/highlighters/main/test-data/empty-command.zsh @@ -30,6 +30,6 @@ BUFFER='echo; ;' expected_region_highlight=( - "5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; - "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ; + "5 5 commandseparator" # ; + "7 7 unknown-token" # ; ) diff --git a/highlighters/main/test-data/empty-command2.zsh b/highlighters/main/test-data/empty-command2.zsh index a4d5538..698b3a7 100644 --- a/highlighters/main/test-data/empty-command2.zsh +++ b/highlighters/main/test-data/empty-command2.zsh @@ -33,6 +33,6 @@ touch ';' BUFFER='echo; ;' expected_region_highlight=( - "5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; - "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ; + "5 5 commandseparator" # ; + "7 7 unknown-token" # ; ) diff --git a/highlighters/main/test-data/exec-redirection1.zsh b/highlighters/main/test-data/exec-redirection1.zsh index 9d74587..47fd9f6 100644 --- a/highlighters/main/test-data/exec-redirection1.zsh +++ b/highlighters/main/test-data/exec-redirection1.zsh @@ -31,9 +31,9 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='exec {foo}>&/tmp ls' expected_region_highlight=( - "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # exec - # TODO: "6 10 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]} 'issue #238'" # {foo} - "11 12 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # >& - "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp - "18 19 ${(q-)ZSH_HIGHLIGHT_STYLES[command]} 'issue #238'" # ls + "1 4 precommand" # exec + # TODO: "6 10 redirection 'issue #238'" # {foo} + "11 12 redirection" # >& + "13 16 path" # /tmp + "18 19 command 'issue #238'" # ls ) diff --git a/highlighters/main/test-data/function.zsh b/highlighters/main/test-data/function.zsh index fa19b91..27c60a1 100644 --- a/highlighters/main/test-data/function.zsh +++ b/highlighters/main/test-data/function.zsh @@ -39,8 +39,8 @@ BUFFER='cd;ls' # Use $unused_highlight to see that function highlighting has precedence over command and builtin expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[function]}" # cd - "4 5 ${(q-)ZSH_HIGHLIGHT_STYLES[function]}" # ls + "1 2 function" # cd + "4 5 function" # ls ) # don't 'unfunction cd ls', since cd() and ls() should still be a functions diff --git a/highlighters/main/test-data/glob.zsh b/highlighters/main/test-data/glob.zsh index 6d4609e..2fd9c6f 100644 --- a/highlighters/main/test-data/glob.zsh +++ b/highlighters/main/test-data/glob.zsh @@ -30,9 +30,9 @@ BUFFER=': foo* bar? *baz qux\?' expected_region_highlight=( - "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # : - "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # foo* - "8 11 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # bar? - "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # *baz - "18 22 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # qux\? + "1 1 builtin" # : + "3 6 globbing" # foo* + "8 11 globbing" # bar? + "13 16 globbing" # *baz + "18 22 default" # qux\? ) diff --git a/highlighters/main/test-data/hashed-command.zsh b/highlighters/main/test-data/hashed-command.zsh index 121f0b8..1cc24b0 100644 --- a/highlighters/main/test-data/hashed-command.zsh +++ b/highlighters/main/test-data/hashed-command.zsh @@ -32,5 +32,5 @@ ZSH_HIGHLIGHT_STYLES[hashed-command]=$unused_highlight BUFFER='zsh_syntax_highlighting_hash' expected_region_highlight=( - "1 28 ${(q-)ZSH_HIGHLIGHT_STYLES[hashed-command]}" + "1 28 hashed-command" ) diff --git a/highlighters/main/test-data/history-expansion.zsh b/highlighters/main/test-data/history-expansion.zsh index 6980b8d..be511b0 100644 --- a/highlighters/main/test-data/history-expansion.zsh +++ b/highlighters/main/test-data/history-expansion.zsh @@ -31,9 +31,9 @@ ZSH_HIGHLIGHT_STYLES[default]=$unused_highlight BUFFER='!foo bar !baz ! ; !' expected_region_highlight=( - "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[history-expansion]}" # !foo - "6 8 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # bar - "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[history-expansion]}" # !baz - "15 15 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # ! (before the semicolon) - "19 19 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ! (after the semicolon) + "1 4 history-expansion" # !foo + "6 8 default" # bar + "10 13 history-expansion" # !baz + "15 15 default" # ! (before the semicolon) + "19 19 reserved-word" # ! (after the semicolon) ) diff --git a/highlighters/main/test-data/history-expansion2.zsh b/highlighters/main/test-data/history-expansion2.zsh index 3840b55..386d0df 100644 --- a/highlighters/main/test-data/history-expansion2.zsh +++ b/highlighters/main/test-data/history-expansion2.zsh @@ -30,5 +30,5 @@ BUFFER='^foo^bar' expected_region_highlight=( - "1 8 ${(q-)ZSH_HIGHLIGHT_STYLES[history-expansion]}" # ^foo^bar + "1 8 history-expansion" # ^foo^bar ) diff --git a/highlighters/main/test-data/multiline-string.zsh b/highlighters/main/test-data/multiline-string.zsh index c393812..484c951 100644 --- a/highlighters/main/test-data/multiline-string.zsh +++ b/highlighters/main/test-data/multiline-string.zsh @@ -31,6 +31,6 @@ PREBUFFER=$'echo "foo1\n' BUFFER='foo2" ./' expected_region_highlight=( - "1 5 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # 'foo2"' - "7 8 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # './' + "1 5 double-quoted-argument" # 'foo2"' + "7 8 path" # './' ) diff --git a/highlighters/main/test-data/multiline-string2.zsh b/highlighters/main/test-data/multiline-string2.zsh index eafb17b..3d45002 100644 --- a/highlighters/main/test-data/multiline-string2.zsh +++ b/highlighters/main/test-data/multiline-string2.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=$unused_highlight BUFFER=$'echo "foo1\n' expected_region_highlight=( - "6 10 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # 'foo2"' + "6 10 double-quoted-argument" # 'foo2"' ) diff --git a/highlighters/main/test-data/multiple-redirections.zsh b/highlighters/main/test-data/multiple-redirections.zsh index 5dc8931..778e712 100644 --- a/highlighters/main/test-data/multiple-redirections.zsh +++ b/highlighters/main/test-data/multiple-redirections.zsh @@ -30,17 +30,17 @@ BUFFER='ps aux | grep java | sort | uniq | tail | head' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ps - "4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # aux - "8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # | - "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # grep - "15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # java - "20 20 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # | - "22 25 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # sort - "27 27 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # | - "29 32 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # uniq - "34 34 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # | - "36 39 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tail - "41 41 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # | - "43 46 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # head + "1 2 command" # ps + "4 6 default" # aux + "8 8 commandseparator" # | + "10 13 command" # grep + "15 18 default" # java + "20 20 commandseparator" # | + "22 25 command" # sort + "27 27 commandseparator" # | + "29 32 command" # uniq + "34 34 commandseparator" # | + "36 39 command" # tail + "41 41 commandseparator" # | + "43 46 command" # head ) diff --git a/highlighters/main/test-data/noglob-alias.zsh b/highlighters/main/test-data/noglob-alias.zsh index df8ad23..6f3a7f7 100644 --- a/highlighters/main/test-data/noglob-alias.zsh +++ b/highlighters/main/test-data/noglob-alias.zsh @@ -31,5 +31,5 @@ alias x=command BUFFER='x ls' expected_region_highlight=( - "3 4 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "3 4 command" # ls ) diff --git a/highlighters/main/test-data/noglob1.zsh b/highlighters/main/test-data/noglob1.zsh index 52e8f57..ea70a83 100644 --- a/highlighters/main/test-data/noglob1.zsh +++ b/highlighters/main/test-data/noglob1.zsh @@ -30,5 +30,5 @@ BUFFER=':; noglob echo *' expected_region_highlight=( - "16 16 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # * + "16 16 default" # * ) diff --git a/highlighters/main/test-data/noglob2.zsh b/highlighters/main/test-data/noglob2.zsh index c51ca8d..6d7a940 100644 --- a/highlighters/main/test-data/noglob2.zsh +++ b/highlighters/main/test-data/noglob2.zsh @@ -30,6 +30,6 @@ BUFFER='noglob echo *; echo *' expected_region_highlight=( - "13 13 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # * - "21 21 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # * + "13 13 default" # * + "21 21 globbing" # * ) diff --git a/highlighters/main/test-data/option-path_dirs.zsh b/highlighters/main/test-data/option-path_dirs.zsh index e1de805..1f3002a 100644 --- a/highlighters/main/test-data/option-path_dirs.zsh +++ b/highlighters/main/test-data/option-path_dirs.zsh @@ -37,5 +37,5 @@ path+=( "$PWD"/foo ) BUFFER='bar/testing-issue-228' expected_region_highlight=( - "1 21 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # bar/testing-issue-228 + "1 21 command" # bar/testing-issue-228 ) diff --git a/highlighters/main/test-data/path-space.zsh b/highlighters/main/test-data/path-space.zsh index d4c9fa6..67a26fd 100644 --- a/highlighters/main/test-data/path-space.zsh +++ b/highlighters/main/test-data/path-space.zsh @@ -32,6 +32,6 @@ touch "A/mu with spaces" BUFFER='ls A/mu\ with\ spaces' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "4 19 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # A/mu\ with\ spaces + "1 2 command" # ls + "4 19 path" # A/mu\ with\ spaces ) diff --git a/highlighters/main/test-data/path-tilde-home.zsh b/highlighters/main/test-data/path-tilde-home.zsh index c5ed284..8b1c680 100644 --- a/highlighters/main/test-data/path-tilde-home.zsh +++ b/highlighters/main/test-data/path-tilde-home.zsh @@ -31,6 +31,6 @@ HOME="." BUFFER='ls ~' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "4 4 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # ~ + "1 2 command" # ls + "4 4 path" # ~ ) diff --git a/highlighters/main/test-data/path-tilde-home2.zsh b/highlighters/main/test-data/path-tilde-home2.zsh index 0726a85..3f7b820 100644 --- a/highlighters/main/test-data/path-tilde-home2.zsh +++ b/highlighters/main/test-data/path-tilde-home2.zsh @@ -31,7 +31,7 @@ HOME="/nonexistent" BUFFER='ls ~' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "4 4 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # ~ + "1 2 command" # ls + "4 4 default" # ~ ) diff --git a/highlighters/main/test-data/path-tilde-named.zsh b/highlighters/main/test-data/path-tilde-named.zsh index 3e396bd..335b3fd 100644 --- a/highlighters/main/test-data/path-tilde-named.zsh +++ b/highlighters/main/test-data/path-tilde-named.zsh @@ -34,6 +34,6 @@ hash -d D=mydir BUFFER='ls ~D/path-tilde-named.test' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "4 27 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # ~D/path-tilde-named.test + "1 2 command" # ls + "4 27 path" # ~D/path-tilde-named.test ) diff --git a/highlighters/main/test-data/path.zsh b/highlighters/main/test-data/path.zsh index 028b4e3..d387eff 100644 --- a/highlighters/main/test-data/path.zsh +++ b/highlighters/main/test-data/path.zsh @@ -32,6 +32,6 @@ touch A/mu BUFFER='ls A/mu' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "4 7 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # A/mu + "1 2 command" # ls + "4 7 path" # A/mu ) diff --git a/highlighters/main/test-data/path_prefix.zsh b/highlighters/main/test-data/path_prefix.zsh index daa0c4b..e945fe2 100644 --- a/highlighters/main/test-data/path_prefix.zsh +++ b/highlighters/main/test-data/path_prefix.zsh @@ -34,5 +34,5 @@ ZSH_HIGHLIGHT_STYLES[path_prefix]=$unused_highlight BUFFER='ls /bin/s' expected_region_highlight=( - "4 9 ${(q-)ZSH_HIGHLIGHT_STYLES[path_prefix]}" # /bin/s + "4 9 path_prefix" # /bin/s ) diff --git a/highlighters/main/test-data/path_prefix2.zsh b/highlighters/main/test-data/path_prefix2.zsh index bd6990c..761c004 100644 --- a/highlighters/main/test-data/path_prefix2.zsh +++ b/highlighters/main/test-data/path_prefix2.zsh @@ -35,5 +35,5 @@ BUFFER='ls /bin/s' WIDGET=accept-line expected_region_highlight=( - "4 9 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # /bin/s + "4 9 default" # /bin/s ) diff --git a/highlighters/main/test-data/precommand.zsh b/highlighters/main/test-data/precommand.zsh index e2fc541..04697cf 100644 --- a/highlighters/main/test-data/precommand.zsh +++ b/highlighters/main/test-data/precommand.zsh @@ -31,7 +31,7 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight BUFFER=': command zzzzzz' expected_region_highlight=( - "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # : - "3 9 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # not precommand - "11 16 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # not unknown-token (since 'zzzzzz' is not a command) + "1 1 builtin" # : + "3 9 default" # not precommand + "11 16 default" # not unknown-token (since 'zzzzzz' is not a command) ) diff --git a/highlighters/main/test-data/prefix-redirection.zsh b/highlighters/main/test-data/prefix-redirection.zsh index 4681584..5a5c0e2 100644 --- a/highlighters/main/test-data/prefix-redirection.zsh +++ b/highlighters/main/test-data/prefix-redirection.zsh @@ -30,10 +30,10 @@ BUFFER='>/tmp >/tmp sudo echo >/tmp foo' expected_region_highlight=( - "2 5 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp - "8 11 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp - "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo - "18 21 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo - "24 27 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp - "29 31 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # foo + "2 5 path" # /tmp + "8 11 path" # /tmp + "13 16 precommand" # sudo + "18 21 builtin" # echo + "24 27 path" # /tmp + "29 31 default" # foo ) diff --git a/highlighters/main/test-data/redirection.zsh b/highlighters/main/test-data/redirection.zsh index c1a2049..e26fb7d 100644 --- a/highlighters/main/test-data/redirection.zsh +++ b/highlighters/main/test-data/redirection.zsh @@ -32,6 +32,6 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='<<>&!bar' expected_region_highlight=( - "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # <<< - "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # >>&! + "1 3 redirection" # <<< + "13 16 redirection" # >>&! ) diff --git a/highlighters/main/test-data/reserved-word.zsh b/highlighters/main/test-data/reserved-word.zsh index 50cd72b..8442a4c 100644 --- a/highlighters/main/test-data/reserved-word.zsh +++ b/highlighters/main/test-data/reserved-word.zsh @@ -31,8 +31,8 @@ ZSH_HIGHLIGHT_STYLES[reserved-word]=$unused_highlight BUFFER='repeat "1" do done' expected_region_highlight=( - "1 6 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # repeat - "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "1" - "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # do - "15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # done + "1 6 reserved-word" # repeat + "8 10 double-quoted-argument" # "1" + "12 13 reserved-word" # do + "15 18 reserved-word" # done ) diff --git a/highlighters/main/test-data/simple-command.zsh b/highlighters/main/test-data/simple-command.zsh index e7a5378..8bb41fd 100644 --- a/highlighters/main/test-data/simple-command.zsh +++ b/highlighters/main/test-data/simple-command.zsh @@ -30,5 +30,5 @@ BUFFER='ls' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "1 2 command" # ls ) diff --git a/highlighters/main/test-data/simple-redirection.zsh b/highlighters/main/test-data/simple-redirection.zsh index f4bd696..e8c25e5 100644 --- a/highlighters/main/test-data/simple-redirection.zsh +++ b/highlighters/main/test-data/simple-redirection.zsh @@ -30,9 +30,9 @@ BUFFER='ps aux | grep java' expected_region_highlight=( - "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ps - "4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # aux - "8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # | - "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # grep - "15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # java + "1 2 command" # ps + "4 6 default" # aux + "8 8 commandseparator" # | + "10 13 command" # grep + "15 18 default" # java ) diff --git a/highlighters/main/test-data/subshell.zsh b/highlighters/main/test-data/subshell.zsh index 17110ed..0080ad2 100644 --- a/highlighters/main/test-data/subshell.zsh +++ b/highlighters/main/test-data/subshell.zsh @@ -30,12 +30,12 @@ BUFFER='tar cf - * | (cd /target; tar xfp -) | { cat }' expected_region_highlight=( - "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tar - "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ( - "15 16 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # cd - "27 29 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tar - "36 36 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ) - "40 40 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # { - "42 44 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # cat - "46 46 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # } + "1 3 command" # tar + "14 14 reserved-word" # ( + "15 16 builtin" # cd + "27 29 command" # tar + "36 36 reserved-word" # ) + "40 40 reserved-word" # { + "42 44 command" # cat + "46 46 reserved-word" # } ) diff --git a/highlighters/main/test-data/sudo-command.zsh b/highlighters/main/test-data/sudo-command.zsh index 0fbbb6f..49fc6a6 100644 --- a/highlighters/main/test-data/sudo-command.zsh +++ b/highlighters/main/test-data/sudo-command.zsh @@ -35,13 +35,13 @@ ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=$unused_highlight BUFFER='sudo -C3 -u otheruser -i ls /; sudo ; sudo -u ;' expected_region_highlight=( - "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo - "6 8 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -C3 - "10 11 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u - "13 21 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser - "23 24 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -i - "26 27 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "29 29 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # / - "37 37 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ;, error because empty command - "47 47 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ;, error because incomplete command + "1 4 precommand" # sudo + "6 8 single-hyphen-option" # -C3 + "10 11 single-hyphen-option" # -u + "13 21 default" # otheruser + "23 24 single-hyphen-option" # -i + "26 27 command" # ls + "29 29 path" # / + "37 37 unknown-token" # ;, error because empty command + "47 47 unknown-token" # ;, error because incomplete command ) diff --git a/highlighters/main/test-data/sudo-comment.zsh b/highlighters/main/test-data/sudo-comment.zsh index bb26fe7..e66f13d 100644 --- a/highlighters/main/test-data/sudo-comment.zsh +++ b/highlighters/main/test-data/sudo-comment.zsh @@ -32,7 +32,7 @@ setopt interactive_comments BUFFER='sudo -u # comment' expected_region_highlight=( - "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo - "6 7 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u - "9 17 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # "# comment" - error because argument missed + "1 4 precommand" # sudo + "6 7 single-hyphen-option" # -u + "9 17 unknown-token" # "# comment" - error because argument missed ) diff --git a/highlighters/main/test-data/sudo-redirection.zsh b/highlighters/main/test-data/sudo-redirection.zsh index 8ef5f9f..5581c1b 100644 --- a/highlighters/main/test-data/sudo-redirection.zsh +++ b/highlighters/main/test-data/sudo-redirection.zsh @@ -31,17 +31,17 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='sudo -u >/tmp otheruser ls; sudo ls; sudo -i ls' expected_region_highlight=( - "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo - "6 7 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u - "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # > - "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp - "15 23 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser - "25 26 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "27 27 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; - "29 32 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo - "34 35 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls - "36 36 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ; - "38 41 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo - "43 44 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -i - "46 47 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "1 4 precommand" # sudo + "6 7 single-hyphen-option" # -u + "9 9 redirection" # > + "10 13 path" # /tmp + "15 23 default" # otheruser + "25 26 command" # ls + "27 27 commandseparator" # ; + "29 32 precommand" # sudo + "34 35 command" # ls + "36 36 commandseparator" # ; + "38 41 precommand" # sudo + "43 44 single-hyphen-option" # -i + "46 47 command" # ls ) diff --git a/highlighters/main/test-data/sudo-redirection2.zsh b/highlighters/main/test-data/sudo-redirection2.zsh index 810ff42..4a2d9d0 100644 --- a/highlighters/main/test-data/sudo-redirection2.zsh +++ b/highlighters/main/test-data/sudo-redirection2.zsh @@ -31,10 +31,10 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='sudo >/tmp -u otheruser ls' expected_region_highlight=( - "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo - "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # > - "7 10 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp - "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u - "15 23 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser - "25 26 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "1 4 precommand" # sudo + "6 6 redirection" # > + "7 10 path" # /tmp + "12 13 single-hyphen-option" # -u + "15 23 default" # otheruser + "25 26 command" # ls ) diff --git a/highlighters/main/test-data/sudo-redirection3.zsh b/highlighters/main/test-data/sudo-redirection3.zsh index 2ac24e3..91d456d 100644 --- a/highlighters/main/test-data/sudo-redirection3.zsh +++ b/highlighters/main/test-data/sudo-redirection3.zsh @@ -31,10 +31,10 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight BUFFER='sudo 2>./. -u otheruser ls' expected_region_highlight=( - "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo - "6 7 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # 2> - "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # ./. # a 3-character path, for alignment with sudo-redirection2.zsh - "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u - "15 23 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser - "25 26 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls + "1 4 precommand" # sudo + "6 7 redirection" # 2> + "8 10 path" # ./. # a 3-character path, for alignment with sudo-redirection2.zsh + "12 13 single-hyphen-option" # -u + "15 23 default" # otheruser + "25 26 command" # ls ) diff --git a/highlighters/main/test-data/tilde-command-word.zsh b/highlighters/main/test-data/tilde-command-word.zsh index cb9c87b..67c996c 100644 --- a/highlighters/main/test-data/tilde-command-word.zsh +++ b/highlighters/main/test-data/tilde-command-word.zsh @@ -32,6 +32,6 @@ hash -d D=/usr/bin BUFFER='~D/env foo' expected_region_highlight=( - "1 6 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ~D/env [= /usr/bin/env]} - "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # foo + "1 6 command" # ~D/env [= /usr/bin/env + "8 10 default" # foo ) diff --git a/highlighters/main/test-data/unbackslash.zsh b/highlighters/main/test-data/unbackslash.zsh index fcdaf44..9731df5 100644 --- a/highlighters/main/test-data/unbackslash.zsh +++ b/highlighters/main/test-data/unbackslash.zsh @@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[command]=$unused_highlight BUFFER='\sh' expected_region_highlight=( - "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # \sh (runs 'sh', bypassing aliases) + "1 3 command" # \sh (runs 'sh', bypassing aliases) ) diff --git a/highlighters/main/test-data/unknown-command.zsh b/highlighters/main/test-data/unknown-command.zsh index 4fd8663..e71faec 100644 --- a/highlighters/main/test-data/unknown-command.zsh +++ b/highlighters/main/test-data/unknown-command.zsh @@ -30,5 +30,5 @@ BUFFER='azertyuiop' expected_region_highlight=( - "1 10 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # azertyuiop + "1 10 unknown-token" # azertyuiop ) diff --git a/highlighters/main/test-data/vanilla-newline.zsh b/highlighters/main/test-data/vanilla-newline.zsh index 4f270a8..bd60ad4 100644 --- a/highlighters/main/test-data/vanilla-newline.zsh +++ b/highlighters/main/test-data/vanilla-newline.zsh @@ -31,9 +31,9 @@ PREBUFFER=$'echo foo; echo bar\n\n\n' BUFFER=' echo baz; echo qux' expected_region_highlight=( - "2 5 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo - "7 9 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # baz - "10 10 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # semicolon - "12 15 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo - "17 19 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # qux + "2 5 builtin" # echo + "7 9 default" # baz + "10 10 commandseparator" # semicolon + "12 15 builtin" # echo + "17 19 default" # qux ) diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index 9254ba4..2886f73 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -103,8 +103,8 @@ run_test_internal() { highlight_zone=${(z)expected_region_highlight[$i]} [[ -n "$highlight_zone[4]" ]] && todo=" # TODO $highlight_zone[4]" for j in {$highlight_zone[1]..$highlight_zone[2]}; do - if [[ "$observed_result[$j]" != "${(Q)highlight_zone[3]}" ]]; then - echo "not ok $i ${(qqq)BUFFER[$highlight_zone[1],$highlight_zone[2]]} [$highlight_zone[1],$highlight_zone[2]]: expected ${(Q)highlight_zone[3]}, observed ${(qqq)observed_result[$j]}.$todo" + if [[ "$observed_result[$j]" != "$ZSH_HIGHLIGHT_STYLES[$highlight_zone[3]]" ]]; then + echo "not ok $i ${(qqq)BUFFER[$highlight_zone[1],$highlight_zone[2]]} [$highlight_zone[1],$highlight_zone[2]]: expected ${(qqq)ZSH_HIGHLIGHT_STYLES[$highlight_zone[3]]}, observed ${(qqq)observed_result[$j]}.$todo" continue 2 fi done