tests: Quote style in expected_region_highlight

This commit is contained in:
Matthew Martin 2016-01-20 00:12:55 -06:00
parent bb8d325c0c
commit 31ac2b36a9
67 changed files with 239 additions and 239 deletions

View File

@ -30,8 +30,8 @@
BUFFER='echo ({x}]' BUFFER='echo ({x}]'
expected_region_highlight=( expected_region_highlight=(
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # ( "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # (
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # { "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # {
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # } "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # }
"10 10 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # ) "10 10 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # )
) )

View File

@ -30,10 +30,10 @@
BUFFER='echo $(echo ${(z)array})' BUFFER='echo $(echo ${(z)array})'
expected_region_highlight=( expected_region_highlight=(
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # ( "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # (
"14 14 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # { "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # {
"15 15 $ZSH_HIGHLIGHT_STYLES[bracket-level-3]" # ( "15 15 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-3]}" # (
"17 17 $ZSH_HIGHLIGHT_STYLES[bracket-level-3]" # ) "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-3]}" # )
"23 23 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # } "23 23 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # }
"24 24 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # ) "24 24 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # )
) )

View File

@ -30,5 +30,5 @@
BUFFER='echo "foo ( bar"' BUFFER='echo "foo ( bar"'
expected_region_highlight=( expected_region_highlight=(
"1 16 $ZSH_HIGHLIGHT_STYLES[none]" # We expect the brackets highlighter to do nothing "1 16 ${(q-)ZSH_HIGHLIGHT_STYLES[none]}" # We expect the brackets highlighter to do nothing
) )

View File

@ -30,8 +30,8 @@
BUFFER='echo ({x})' BUFFER='echo ({x})'
expected_region_highlight=( expected_region_highlight=(
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # ( "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # (
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # { "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # {
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # } "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # }
"10 10 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # ) "10 10 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # )
) )

View File

@ -30,7 +30,7 @@
BUFFER='echo ({x}' BUFFER='echo ({x}'
expected_region_highlight=( expected_region_highlight=(
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # ( "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # (
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # { "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # {
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # } "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-2]}" # }
) )

View File

@ -30,7 +30,7 @@
BUFFER='echo {x})' BUFFER='echo {x})'
expected_region_highlight=( expected_region_highlight=(
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # { "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # {
"8 8 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # } "8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-level-1]}" # }
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # ) "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[bracket-error]}" # )
) )

View File

@ -34,5 +34,5 @@ ZSH_HIGHLIGHT_STYLES[alias]=$unused_highlight
BUFFER='x=y ls' BUFFER='x=y ls'
expected_region_highlight=( expected_region_highlight=(
"1 3 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # x=y "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # x=y
) )

View File

@ -43,9 +43,9 @@ BUFFER='x.alias2; alias1'
expected_region_highlight=() expected_region_highlight=()
if [[ "$(type -w x.alias2)" == *suffix* ]]; then if [[ "$(type -w x.alias2)" == *suffix* ]]; then
expected_region_highlight+=( expected_region_highlight+=(
"1 8 $ZSH_HIGHLIGHT_STYLES[suffix-alias]" # x.alias2 "1 8 ${(q-)ZSH_HIGHLIGHT_STYLES[suffix-alias]}" # x.alias2
) )
fi fi
expected_region_highlight+=( expected_region_highlight+=(
"11 16 $ZSH_HIGHLIGHT_STYLES[alias]" # alias1 "11 16 ${(q-)ZSH_HIGHLIGHT_STYLES[alias]}" # alias1
) )

View File

@ -30,11 +30,11 @@
BUFFER='() echo hello; () { echo world }' BUFFER='() echo hello; () { echo world }'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # () "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ()
"4 7 $ZSH_HIGHLIGHT_STYLES[command]" # echo "4 7 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # echo
"9 13 $ZSH_HIGHLIGHT_STYLES[default]" # hello "9 13 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # hello
"14 14 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ;
"16 17 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # () "16 17 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ()
"19 19 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # { "19 19 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # {
"21 24 $ZSH_HIGHLIGHT_STYLES[command]" # echo "21 24 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # echo
) )

View File

@ -35,6 +35,6 @@
BUFFER='(( x == 42 ))' BUFFER='(( x == 42 ))'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # (( "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ((
"12 13 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # )) "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ))
) )

View File

@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight
BUFFER='a+=(lorem ipsum)' BUFFER='a+=(lorem ipsum)'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[assign]" # a+=( "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # a+=(
) )

View File

@ -31,8 +31,8 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight
BUFFER='(A=(hello world))' BUFFER='(A=(hello world))'
expected_region_highlight=( expected_region_highlight=(
"1 1 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ( "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # (
"2 4 $ZSH_HIGHLIGHT_STYLES[assign]" # A=( "2 4 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # A=(
"16 16 $ZSH_HIGHLIGHT_STYLES[assign]" # ) "16 16 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # )
"17 17 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ) "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # )
) )

View File

@ -31,6 +31,6 @@ ZSH_HIGHLIGHT_STYLES[commandseparator]=$unused_highlight
BUFFER='A=1; echo hello world' BUFFER='A=1; echo hello world'
expected_region_highlight=( expected_region_highlight=(
"4 4 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; "4 4 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ;
"6 9 $ZSH_HIGHLIGHT_STYLES[command]" # echo "6 9 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # echo
) )

View File

@ -31,7 +31,7 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight
BUFFER='(A=1)' BUFFER='(A=1)'
expected_region_highlight=( expected_region_highlight=(
"1 1 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ( "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # (
"2 4 $ZSH_HIGHLIGHT_STYLES[assign]" # A=1 "2 4 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # A=1
"5 5 $ZSH_HIGHLIGHT_STYLES[reserved-word] 'issue #231'" # ) "5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]} 'issue #231'" # )
) )

View File

@ -31,8 +31,8 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight
BUFFER='A=1 b=("foo" bar)' BUFFER='A=1 b=("foo" bar)'
expected_region_highlight=( expected_region_highlight=(
"1 3 $ZSH_HIGHLIGHT_STYLES[assign]" # A=1 "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # A=1
"5 7 $ZSH_HIGHLIGHT_STYLES[assign]" # b=( "5 7 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # b=(
"8 12 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo" "8 12 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo"
"17 17 $ZSH_HIGHLIGHT_STYLES[assign]" # ) "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[assign]}" # )
) )

View File

@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=$unused_highlight
BUFFER='echo `echo 42`' BUFFER='echo `echo 42`'
expected_region_highlight=( expected_region_highlight=(
"6 14 $ZSH_HIGHLIGHT_STYLES[back-quoted-argument]" "6 14 ${(q-)ZSH_HIGHLIGHT_STYLES[back-quoted-argument]}"
) )

View File

@ -32,8 +32,8 @@ ZSH_HIGHLIGHT_STYLES[commandseparator]=$unused_highlight
BUFFER=':; pwd &! ls' BUFFER=':; pwd &! ls'
expected_region_highlight=( expected_region_highlight=(
"2 2 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; "2 2 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ;
"4 6 $ZSH_HIGHLIGHT_STYLES[builtin]" # pwd "4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # pwd
"8 9 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # &! "8 9 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # &!
"11 12 $ZSH_HIGHLIGHT_STYLES[command]" # ls "11 12 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
) )

View File

@ -32,7 +32,7 @@ setopt interactive_comments
BUFFER='echo "foo #bar" #baz # quux' BUFFER='echo "foo #bar" #baz # quux'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[command]" # echo "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # echo
"6 15 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo #bar" "6 15 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo #bar"
"17 27 ${(q-)ZSH_HIGHLIGHT_STYLES[comment]}" # #baz # quux "17 27 ${(q-)ZSH_HIGHLIGHT_STYLES[comment]}" # #baz # quux
) )

View File

@ -31,6 +31,6 @@ x=/usr/bin/env
BUFFER='$x "argument"' BUFFER='$x "argument"'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # $x "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # $x
"4 13 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "argument" "4 13 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "argument"
) )

View File

@ -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' BUFFER='while if echo Hello; then ls /; else ls; fi; do stat "x"; done; repeat 10 ls'
expected_region_highlight+=( expected_region_highlight+=(
"1 5 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # while "1 5 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # while
"7 8 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # if "7 8 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # if
"10 13 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo
"15 19 $ZSH_HIGHLIGHT_STYLES[default]" # Hello "15 19 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # Hello
"22 25 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # then "22 25 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # then
"27 28 $ZSH_HIGHLIGHT_STYLES[command]" # ls "27 28 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"30 30 $ZSH_HIGHLIGHT_STYLES[path]" # / "30 30 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /
"31 31 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; "31 31 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ;
"33 36 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # else "33 36 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # else
"38 39 $ZSH_HIGHLIGHT_STYLES[command]" # ls "38 39 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"42 43 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # fi "42 43 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # fi
"46 47 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # do "46 47 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # do
"49 52 $ZSH_HIGHLIGHT_STYLES[command]" # stat "49 52 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # stat
"54 56 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "x" "54 56 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "x"
"59 62 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # done "59 62 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # done
"65 70 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # repeat "65 70 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # repeat
"75 76 $ZSH_HIGHLIGHT_STYLES[command]" # ls "75 76 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
) )

View File

@ -31,6 +31,6 @@ ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]=$unused_highlight
BUFFER=": \$'*' 'foo'" BUFFER=": \$'*' 'foo'"
expected_region_highlight=( expected_region_highlight=(
"3 6 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # $'*' - not a glob "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $'*' - not a glob
"8 12 $ZSH_HIGHLIGHT_STYLES[single-quoted-argument]" # 'foo' "8 12 ${(q-)ZSH_HIGHLIGHT_STYLES[single-quoted-argument]}" # 'foo'
) )

View File

@ -31,11 +31,11 @@ ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]=$unused_highlight
BUFFER=": \$'foo\xbar\udeadbeef\uzzzz'" BUFFER=": \$'foo\xbar\udeadbeef\uzzzz'"
expected_region_highlight=( expected_region_highlight=(
"3 7 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # $'foo "3 7 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $'foo
"8 11 $ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]" # \xba "8 11 ${(q-)ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]}" # \xba
"12 12 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # r "12 12 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # r
"13 18 $ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]" # \dead "13 18 ${(q-)ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]}" # \dead
"19 22 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # beef "19 22 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # beef
"23 24 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # \u "23 24 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # \u
"25 29 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # zzzz' "25 29 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # zzzz'
) )

View File

@ -33,6 +33,6 @@ ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]=$unused_highlight
BUFFER=": \$'\xa1" BUFFER=": \$'\xa1"
expected_region_highlight=( expected_region_highlight=(
"3 4 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # $' "3 4 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $'
"5 8 $ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]" # \xa1 "5 8 ${(q-)ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]}" # \xa1
) )

View File

@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=$unused_highlight
BUFFER='hello --world' BUFFER='hello --world'
expected_region_highlight=( expected_region_highlight=(
"7 13 $ZSH_HIGHLIGHT_STYLES[double-hyphen-option]" # --world "7 13 ${(q-)ZSH_HIGHLIGHT_STYLES[double-hyphen-option]}" # --world
) )

View File

@ -31,15 +31,15 @@ BUFFER=': "foo$bar:\`:\":\$:'
BUFFER+=\\\\:\" BUFFER+=\\\\:\"
expected_region_highlight=( expected_region_highlight=(
"3 6 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo
"7 10 $ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]" # $bar "7 10 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # $bar
"11 11 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # : "11 11 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # :
"12 13 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \` "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \`
"14 14 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # : "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # :
"15 16 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \$ "15 16 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \$
"17 17 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # : "17 17 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # :
"18 19 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \" "18 19 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \"
"20 20 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # : "20 20 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # :
"21 22 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \\ "21 22 ${(q-)ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]}" # \\
"23 24 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # :" "23 24 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # :"
) )

View File

@ -32,6 +32,6 @@
BUFFER=': "foo$bar' BUFFER=': "foo$bar'
expected_region_highlight=( expected_region_highlight=(
"3 6 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "foo
"7 10 $ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]" # $bar "7 10 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # $bar
) )

View File

@ -31,9 +31,9 @@ BUFFER=': "$" "$42foo"'
BUFFER+=\ \"\\\'\\x\" BUFFER+=\ \"\\\'\\x\"
expected_region_highlight=( expected_region_highlight=(
"3 5 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "$" "3 5 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "$"
"7 7 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # " "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "
"8 10 $ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]" # $42 "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # $42
"11 14 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # foo" "11 14 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # foo"
"16 21 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "\'\x" - \' and \x are not escape sequences "16 21 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "\'\x" - \' and \x are not escape sequences
) )

View File

@ -30,7 +30,7 @@
BUFFER=': "${foo}bar"' BUFFER=': "${foo}bar"'
expected_region_highlight=( expected_region_highlight=(
"3 3 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # " "3 3 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "
"4 9 $ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]" # ${foo} "4 9 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]}" # ${foo}
"10 13 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # bar" "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # bar"
) )

View File

@ -30,6 +30,6 @@
BUFFER='echo; ;' BUFFER='echo; ;'
expected_region_highlight=( expected_region_highlight=(
"5 5 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; "5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ;
"7 7 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ; "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ;
) )

View File

@ -33,6 +33,6 @@ touch ';'
BUFFER='echo; ;' BUFFER='echo; ;'
expected_region_highlight=( expected_region_highlight=(
"5 5 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; "5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ;
"7 7 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ; "7 7 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ;
) )

View File

@ -31,9 +31,9 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight
BUFFER='exec {foo}>&/tmp ls' BUFFER='exec {foo}>&/tmp ls'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # exec "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # exec
# TODO: "6 10 $ZSH_HIGHLIGHT_STYLES[redirection] 'issue #238'" # {foo} # TODO: "6 10 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]} 'issue #238'" # {foo}
"11 12 $ZSH_HIGHLIGHT_STYLES[redirection]" # >& "11 12 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # >&
"13 16 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp
"18 19 $ZSH_HIGHLIGHT_STYLES[command] 'issue #238'" # ls "18 19 ${(q-)ZSH_HIGHLIGHT_STYLES[command]} 'issue #238'" # ls
) )

View File

@ -39,8 +39,8 @@ BUFFER='cd;ls'
# Use $unused_highlight to see that function highlighting has precedence over command and builtin # Use $unused_highlight to see that function highlighting has precedence over command and builtin
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[function]" # cd "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[function]}" # cd
"4 5 $ZSH_HIGHLIGHT_STYLES[function]" # ls "4 5 ${(q-)ZSH_HIGHLIGHT_STYLES[function]}" # ls
) )
# don't 'unfunction cd ls', since cd() and ls() should still be a functions # don't 'unfunction cd ls', since cd() and ls() should still be a functions

View File

@ -30,9 +30,9 @@
BUFFER=': foo* bar? *baz qux\?' BUFFER=': foo* bar? *baz qux\?'
expected_region_highlight=( expected_region_highlight=(
"1 1 $ZSH_HIGHLIGHT_STYLES[builtin]" # : "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # :
"3 6 $ZSH_HIGHLIGHT_STYLES[globbing]" # foo* "3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # foo*
"8 11 $ZSH_HIGHLIGHT_STYLES[globbing]" # bar? "8 11 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # bar?
"13 16 $ZSH_HIGHLIGHT_STYLES[globbing]" # *baz "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # *baz
"18 22 $ZSH_HIGHLIGHT_STYLES[default]" # qux\? "18 22 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # qux\?
) )

View File

@ -32,5 +32,5 @@ ZSH_HIGHLIGHT_STYLES[hashed-command]=$unused_highlight
BUFFER='zsh_syntax_highlighting_hash' BUFFER='zsh_syntax_highlighting_hash'
expected_region_highlight=( expected_region_highlight=(
"1 28 $ZSH_HIGHLIGHT_STYLES[hashed-command]" "1 28 ${(q-)ZSH_HIGHLIGHT_STYLES[hashed-command]}"
) )

View File

@ -31,9 +31,9 @@ ZSH_HIGHLIGHT_STYLES[default]=$unused_highlight
BUFFER='!foo bar !baz ! ; !' BUFFER='!foo bar !baz ! ; !'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # !foo "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[history-expansion]}" # !foo
"6 8 $ZSH_HIGHLIGHT_STYLES[default]" # bar "6 8 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # bar
"10 13 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # !baz "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[history-expansion]}" # !baz
"15 15 $ZSH_HIGHLIGHT_STYLES[default]" # ! (before the semicolon) "15 15 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # ! (before the semicolon)
"19 19 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ! (after the semicolon) "19 19 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ! (after the semicolon)
) )

View File

@ -30,5 +30,5 @@
BUFFER='^foo^bar' BUFFER='^foo^bar'
expected_region_highlight=( expected_region_highlight=(
"1 8 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # ^foo^bar "1 8 ${(q-)ZSH_HIGHLIGHT_STYLES[history-expansion]}" # ^foo^bar
) )

View File

@ -31,6 +31,6 @@ PREBUFFER=$'echo "foo1\n'
BUFFER='foo2" ./' BUFFER='foo2" ./'
expected_region_highlight=( expected_region_highlight=(
"1 5 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # 'foo2"' "1 5 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # 'foo2"'
"7 8 $ZSH_HIGHLIGHT_STYLES[path]" # './' "7 8 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # './'
) )

View File

@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=$unused_highlight
BUFFER=$'echo "foo1\n' BUFFER=$'echo "foo1\n'
expected_region_highlight=( expected_region_highlight=(
"6 10 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # 'foo2"' "6 10 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # 'foo2"'
) )

View File

@ -30,17 +30,17 @@
BUFFER='ps aux | grep java | sort | uniq | tail | head' BUFFER='ps aux | grep java | sort | uniq | tail | head'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ps "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ps
"4 6 $ZSH_HIGHLIGHT_STYLES[default]" # aux "4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # aux
"8 8 $ZSH_HIGHLIGHT_STYLES[default]" # | "8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"10 13 $ZSH_HIGHLIGHT_STYLES[command]" # grep "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # grep
"15 18 $ZSH_HIGHLIGHT_STYLES[default]" # java "15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # java
"20 20 $ZSH_HIGHLIGHT_STYLES[default]" # | "20 20 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"22 25 $ZSH_HIGHLIGHT_STYLES[command]" # sort "22 25 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # sort
"27 27 $ZSH_HIGHLIGHT_STYLES[default]" # | "27 27 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"29 32 $ZSH_HIGHLIGHT_STYLES[command]" # uniq "29 32 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # uniq
"34 34 $ZSH_HIGHLIGHT_STYLES[default]" # | "34 34 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"36 39 $ZSH_HIGHLIGHT_STYLES[command]" # tail "36 39 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tail
"41 41 $ZSH_HIGHLIGHT_STYLES[default]" # | "41 41 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"43 46 $ZSH_HIGHLIGHT_STYLES[command]" # head "43 46 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # head
) )

View File

@ -31,5 +31,5 @@ alias x=command
BUFFER='x ls' BUFFER='x ls'
expected_region_highlight=( expected_region_highlight=(
"3 4 $ZSH_HIGHLIGHT_STYLES[command]" # ls "3 4 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
) )

View File

@ -30,5 +30,5 @@
BUFFER=':; noglob echo *' BUFFER=':; noglob echo *'
expected_region_highlight=( expected_region_highlight=(
"16 16 $ZSH_HIGHLIGHT_STYLES[default]" # * "16 16 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # *
) )

View File

@ -30,6 +30,6 @@
BUFFER='noglob echo *; echo *' BUFFER='noglob echo *; echo *'
expected_region_highlight=( expected_region_highlight=(
"13 13 $ZSH_HIGHLIGHT_STYLES[default]" # * "13 13 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # *
"21 21 $ZSH_HIGHLIGHT_STYLES[globbing]" # * "21 21 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # *
) )

View File

@ -37,5 +37,5 @@ path+=( "$PWD"/foo )
BUFFER='bar/testing-issue-228' BUFFER='bar/testing-issue-228'
expected_region_highlight=( expected_region_highlight=(
"1 21 $ZSH_HIGHLIGHT_STYLES[command]" # bar/testing-issue-228 "1 21 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # bar/testing-issue-228
) )

View File

@ -32,6 +32,6 @@ touch "A/mu with spaces"
BUFFER='ls A/mu\ with\ spaces' BUFFER='ls A/mu\ with\ spaces'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"4 19 $ZSH_HIGHLIGHT_STYLES[path]" # A/mu\ with\ spaces "4 19 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # A/mu\ with\ spaces
) )

View File

@ -31,6 +31,6 @@ HOME="."
BUFFER='ls ~' BUFFER='ls ~'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"4 4 $ZSH_HIGHLIGHT_STYLES[path]" # ~ "4 4 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # ~
) )

View File

@ -31,7 +31,7 @@ HOME="/nonexistent"
BUFFER='ls ~' BUFFER='ls ~'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"4 4 $ZSH_HIGHLIGHT_STYLES[default]" # ~ "4 4 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # ~
) )

View File

@ -34,6 +34,6 @@ hash -d D=mydir
BUFFER='ls ~D/path-tilde-named.test' BUFFER='ls ~D/path-tilde-named.test'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"4 27 $ZSH_HIGHLIGHT_STYLES[path]" # ~D/path-tilde-named.test "4 27 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # ~D/path-tilde-named.test
) )

View File

@ -32,6 +32,6 @@ touch A/mu
BUFFER='ls A/mu' BUFFER='ls A/mu'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"4 7 $ZSH_HIGHLIGHT_STYLES[path]" # A/mu "4 7 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # A/mu
) )

View File

@ -34,5 +34,5 @@ ZSH_HIGHLIGHT_STYLES[path_prefix]=$unused_highlight
BUFFER='ls /bin/s' BUFFER='ls /bin/s'
expected_region_highlight=( expected_region_highlight=(
"4 9 $ZSH_HIGHLIGHT_STYLES[path_prefix]" # /bin/s "4 9 ${(q-)ZSH_HIGHLIGHT_STYLES[path_prefix]}" # /bin/s
) )

View File

@ -35,5 +35,5 @@ BUFFER='ls /bin/s'
WIDGET=accept-line WIDGET=accept-line
expected_region_highlight=( expected_region_highlight=(
"4 9 $ZSH_HIGHLIGHT_STYLES[default]" # /bin/s "4 9 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # /bin/s
) )

View File

@ -31,7 +31,7 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight
BUFFER=': command zzzzzz' BUFFER=': command zzzzzz'
expected_region_highlight=( expected_region_highlight=(
"1 1 $ZSH_HIGHLIGHT_STYLES[command]" # ls "1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"3 9 $ZSH_HIGHLIGHT_STYLES[default]" # not precommand "3 9 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # not precommand
"11 16 $ZSH_HIGHLIGHT_STYLES[default]" # not unknown-token (since 'zzzzzz' is not a command) "11 16 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # not unknown-token (since 'zzzzzz' is not a command)
) )

View File

@ -30,10 +30,10 @@
BUFFER='>/tmp >/tmp sudo echo >/tmp foo' BUFFER='>/tmp >/tmp sudo echo >/tmp foo'
expected_region_highlight=( expected_region_highlight=(
"2 5 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp "2 5 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp
"8 11 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp "8 11 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp
"13 16 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo
"18 21 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo "18 21 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo
"24 27 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp "24 27 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp
"29 31 $ZSH_HIGHLIGHT_STYLES[default]" # foo "29 31 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # foo
) )

View File

@ -32,6 +32,6 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight
BUFFER='<<<foo echo >>&!bar' BUFFER='<<<foo echo >>&!bar'
expected_region_highlight=( expected_region_highlight=(
"1 3 $ZSH_HIGHLIGHT_STYLES[redirection]" # <<< "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # <<<
"13 16 $ZSH_HIGHLIGHT_STYLES[redirection]" # >>&! "13 16 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # >>&!
) )

View File

@ -31,8 +31,8 @@ ZSH_HIGHLIGHT_STYLES[reserved-word]=$unused_highlight
BUFFER='repeat "1" do done' BUFFER='repeat "1" do done'
expected_region_highlight=( expected_region_highlight=(
"1 6 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # repeat "1 6 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # repeat
"8 10 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "1" "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # "1"
"12 13 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # do "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # do
"15 18 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # done "15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # done
) )

View File

@ -30,5 +30,5 @@
BUFFER='ls' BUFFER='ls'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
) )

View File

@ -30,9 +30,9 @@
BUFFER='ps aux | grep java' BUFFER='ps aux | grep java'
expected_region_highlight=( expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ps "1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ps
"4 6 $ZSH_HIGHLIGHT_STYLES[default]" # aux "4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # aux
"8 8 $ZSH_HIGHLIGHT_STYLES[default]" # | "8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"10 13 $ZSH_HIGHLIGHT_STYLES[command]" # grep "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # grep
"15 18 $ZSH_HIGHLIGHT_STYLES[default]" # java "15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # java
) )

View File

@ -30,12 +30,12 @@
BUFFER='tar cf - * | (cd /target; tar xfp -) | { cat }' BUFFER='tar cf - * | (cd /target; tar xfp -) | { cat }'
expected_region_highlight=( expected_region_highlight=(
"1 3 $ZSH_HIGHLIGHT_STYLES[command]" # tar "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tar
"14 14 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ( "14 14 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # (
"15 16 $ZSH_HIGHLIGHT_STYLES[command]" # cd "15 16 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # cd
"27 29 $ZSH_HIGHLIGHT_STYLES[command]" # tar "27 29 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tar
"36 36 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ) "36 36 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # )
"40 40 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # { "40 40 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # {
"42 44 $ZSH_HIGHLIGHT_STYLES[command]" # cat "42 44 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # cat
"46 46 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # } "46 46 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # }
) )

View File

@ -35,13 +35,13 @@ ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=$unused_highlight
BUFFER='sudo -C3 -u otheruser -i ls /; sudo ; sudo -u ;' BUFFER='sudo -C3 -u otheruser -i ls /; sudo ; sudo -u ;'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo
"6 8 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -C3 "6 8 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -C3
"10 11 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u "10 11 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u
"13 21 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser "13 21 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser
"23 24 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -i "23 24 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -i
"26 27 $ZSH_HIGHLIGHT_STYLES[command]" # ls "26 27 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"29 29 $ZSH_HIGHLIGHT_STYLES[path]" # / "29 29 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /
"37 37 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ;, error because empty command "37 37 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ;, error because empty command
"47 47 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ;, error because incomplete command "47 47 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # ;, error because incomplete command
) )

View File

@ -32,7 +32,7 @@ setopt interactive_comments
BUFFER='sudo -u # comment' BUFFER='sudo -u # comment'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo
"6 7 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u "6 7 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u
"9 17 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # "# comment" - error because argument missed "9 17 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # "# comment" - error because argument missed
) )

View File

@ -31,17 +31,17 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight
BUFFER='sudo -u >/tmp otheruser ls; sudo ls; sudo -i ls' BUFFER='sudo -u >/tmp otheruser ls; sudo ls; sudo -i ls'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo
"6 7 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u "6 7 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u
"9 9 $ZSH_HIGHLIGHT_STYLES[redirection]" # > "9 9 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # >
"10 13 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp "10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp
"15 23 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser "15 23 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser
"25 26 $ZSH_HIGHLIGHT_STYLES[command]" # ls "25 26 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"27 27 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; "27 27 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ;
"29 32 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo "29 32 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo
"34 35 $ZSH_HIGHLIGHT_STYLES[command]" # ls "34 35 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"36 36 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; "36 36 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ;
"38 41 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo "38 41 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo
"43 44 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -i "43 44 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -i
"46 47 $ZSH_HIGHLIGHT_STYLES[command]" # ls "46 47 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
) )

View File

@ -31,10 +31,10 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight
BUFFER='sudo >/tmp -u otheruser ls' BUFFER='sudo >/tmp -u otheruser ls'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo
"6 6 $ZSH_HIGHLIGHT_STYLES[redirection]" # > "6 6 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # >
"7 10 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp "7 10 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # /tmp
"12 13 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u
"15 23 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser "15 23 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser
"25 26 $ZSH_HIGHLIGHT_STYLES[command]" # ls "25 26 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
) )

View File

@ -31,10 +31,10 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight
BUFFER='sudo 2>./. -u otheruser ls' BUFFER='sudo 2>./. -u otheruser ls'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo "1 4 ${(q-)ZSH_HIGHLIGHT_STYLES[precommand]}" # sudo
"6 7 $ZSH_HIGHLIGHT_STYLES[redirection]" # 2> "6 7 ${(q-)ZSH_HIGHLIGHT_STYLES[redirection]}" # 2>
"8 10 $ZSH_HIGHLIGHT_STYLES[path]" # ./. # a 3-character path, for alignment with sudo-redirection2.zsh "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # ./. # a 3-character path, for alignment with sudo-redirection2.zsh
"12 13 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u "12 13 ${(q-)ZSH_HIGHLIGHT_STYLES[single-hyphen-option]}" # -u
"15 23 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser "15 23 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # otheruser
"25 26 $ZSH_HIGHLIGHT_STYLES[command]" # ls "25 26 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
) )

View File

@ -32,6 +32,6 @@ hash -d D=/usr/bin
BUFFER='~D/env foo' BUFFER='~D/env foo'
expected_region_highlight=( expected_region_highlight=(
"1 6 $ZSH_HIGHLIGHT_STYLES[command]" # ~D/env [= /usr/bin/env] "1 6 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ~D/env [= /usr/bin/env]}
"8 10 $ZSH_HIGHLIGHT_STYLES[default]" # foo "8 10 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # foo
) )

View File

@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[command]=$unused_highlight
BUFFER='\sh' BUFFER='\sh'
expected_region_highlight=( expected_region_highlight=(
"1 3 $ZSH_HIGHLIGHT_STYLES[command]" # \sh (runs 'sh', bypassing aliases) "1 3 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # \sh (runs 'sh', bypassing aliases)
) )

View File

@ -30,5 +30,5 @@
BUFFER='azertyuiop' BUFFER='azertyuiop'
expected_region_highlight=( expected_region_highlight=(
"1 10 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # azertyuiop "1 10 ${(q-)ZSH_HIGHLIGHT_STYLES[unknown-token]}" # azertyuiop
) )

View File

@ -31,9 +31,9 @@ PREBUFFER=$'echo foo; echo bar\n\n\n'
BUFFER=' echo baz; echo qux' BUFFER=' echo baz; echo qux'
expected_region_highlight=( expected_region_highlight=(
"2 5 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo "2 5 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo
"7 9 $ZSH_HIGHLIGHT_STYLES[default]" # baz "7 9 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # baz
"10 10 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # semicolon "10 10 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # semicolon
"12 15 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo "12 15 ${(q-)ZSH_HIGHLIGHT_STYLES[builtin]}" # echo
"17 19 $ZSH_HIGHLIGHT_STYLES[default]" # qux "17 19 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # qux
) )

View File

@ -103,8 +103,8 @@ run_test_internal() {
highlight_zone=${(z)expected_region_highlight[$i]} highlight_zone=${(z)expected_region_highlight[$i]}
[[ -n "$highlight_zone[4]" ]] && todo=" # TODO $highlight_zone[4]" [[ -n "$highlight_zone[4]" ]] && todo=" # TODO $highlight_zone[4]"
for j in {$highlight_zone[1]..$highlight_zone[2]}; do for j in {$highlight_zone[1]..$highlight_zone[2]}; do
if [[ "$observed_result[$j]" != "$highlight_zone[3]" ]]; then 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 ${(qqq)highlight_zone[3]}, observed ${(qqq)observed_result[$j]}.$todo" 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"
continue 2 continue 2
fi fi
done done