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}]'
expected_region_highlight=(
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # (
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # {
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # }
"10 10 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # )
"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]}" # )
)

View File

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

View File

@ -30,5 +30,5 @@
BUFFER='echo "foo ( bar"'
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})'
expected_region_highlight=(
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # (
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # {
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # }
"10 10 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # )
"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]}" # )
)

View File

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

View File

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

View File

@ -34,5 +34,5 @@ ZSH_HIGHLIGHT_STYLES[alias]=$unused_highlight
BUFFER='x=y ls'
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=()
if [[ "$(type -w x.alias2)" == *suffix* ]]; then
expected_region_highlight+=(
"1 8 $ZSH_HIGHLIGHT_STYLES[suffix-alias]" # x.alias2
"1 8 ${(q-)ZSH_HIGHLIGHT_STYLES[suffix-alias]}" # x.alias2
)
fi
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 }'
expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ()
"4 7 $ZSH_HIGHLIGHT_STYLES[command]" # echo
"9 13 $ZSH_HIGHLIGHT_STYLES[default]" # hello
"14 14 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ;
"16 17 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ()
"19 19 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # {
"21 24 $ZSH_HIGHLIGHT_STYLES[command]" # echo
"1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[reserved-word]}" # ()
"4 7 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # 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[command]}" # echo
)

View File

@ -35,6 +35,6 @@
BUFFER='(( x == 42 ))'
expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ((
"12 13 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ))
"1 2 ${(q-)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)'
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))'
expected_region_highlight=(
"1 1 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # (
"2 4 $ZSH_HIGHLIGHT_STYLES[assign]" # A=(
"16 16 $ZSH_HIGHLIGHT_STYLES[assign]" # )
"17 17 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # )
"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]}" # )
)

View File

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

View File

@ -31,7 +31,7 @@ ZSH_HIGHLIGHT_STYLES[assign]=$unused_highlight
BUFFER='(A=1)'
expected_region_highlight=(
"1 1 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # (
"2 4 $ZSH_HIGHLIGHT_STYLES[assign]" # A=1
"5 5 $ZSH_HIGHLIGHT_STYLES[reserved-word] 'issue #231'" # )
"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'" # )
)

View File

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

View File

@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[back-quoted-argument]=$unused_highlight
BUFFER='echo `echo 42`'
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'
expected_region_highlight=(
"2 2 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ;
"4 6 $ZSH_HIGHLIGHT_STYLES[builtin]" # pwd
"8 9 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # &!
"11 12 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"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
)

View File

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

View File

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

View File

@ -31,6 +31,6 @@ ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]=$unused_highlight
BUFFER=": \$'*' 'foo'"
expected_region_highlight=(
"3 6 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # $'*' - not a glob
"8 12 $ZSH_HIGHLIGHT_STYLES[single-quoted-argument]" # 'foo'
"3 6 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $'*' - not a glob
"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'"
expected_region_highlight=(
"3 7 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # $'foo
"8 11 $ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]" # \xba
"12 12 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # r
"13 18 $ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]" # \dead
"19 22 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # beef
"23 24 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # \u
"25 29 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # zzzz'
"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'
)

View File

@ -33,6 +33,6 @@ ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]=$unused_highlight
BUFFER=": \$'\xa1"
expected_region_highlight=(
"3 4 $ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]" # $'
"5 8 $ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]" # \xa1
"3 4 ${(q-)ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]}" # $'
"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'
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+=\\\\:\"
expected_region_highlight=(
"3 6 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo
"7 10 $ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]" # $bar
"11 11 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # :
"12 13 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \`
"14 14 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # :
"15 16 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \$
"17 17 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # :
"18 19 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \"
"20 20 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # :
"21 22 $ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]" # \\
"23 24 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # :"
"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]}" # :"
)

View File

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

View File

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

View File

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

View File

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

View File

@ -33,6 +33,6 @@ touch ';'
BUFFER='echo; ;'
expected_region_highlight=(
"5 5 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ;
"7 7 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ;
"5 5 ${(q-)ZSH_HIGHLIGHT_STYLES[commandseparator]}" # ;
"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'
expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # exec
# TODO: "6 10 $ZSH_HIGHLIGHT_STYLES[redirection] 'issue #238'" # {foo}
"11 12 $ZSH_HIGHLIGHT_STYLES[redirection]" # >&
"13 16 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp
"18 19 $ZSH_HIGHLIGHT_STYLES[command] 'issue #238'" # ls
"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
)

View File

@ -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 $ZSH_HIGHLIGHT_STYLES[function]" # cd
"4 5 $ZSH_HIGHLIGHT_STYLES[function]" # ls
"1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[function]}" # cd
"4 5 ${(q-)ZSH_HIGHLIGHT_STYLES[function]}" # ls
)
# 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\?'
expected_region_highlight=(
"1 1 $ZSH_HIGHLIGHT_STYLES[builtin]" # :
"3 6 $ZSH_HIGHLIGHT_STYLES[globbing]" # foo*
"8 11 $ZSH_HIGHLIGHT_STYLES[globbing]" # bar?
"13 16 $ZSH_HIGHLIGHT_STYLES[globbing]" # *baz
"18 22 $ZSH_HIGHLIGHT_STYLES[default]" # qux\?
"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\?
)

View File

@ -32,5 +32,5 @@ ZSH_HIGHLIGHT_STYLES[hashed-command]=$unused_highlight
BUFFER='zsh_syntax_highlighting_hash'
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 ! ; !'
expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # !foo
"6 8 $ZSH_HIGHLIGHT_STYLES[default]" # bar
"10 13 $ZSH_HIGHLIGHT_STYLES[history-expansion]" # !baz
"15 15 $ZSH_HIGHLIGHT_STYLES[default]" # ! (before the semicolon)
"19 19 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ! (after the semicolon)
"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)
)

View File

@ -30,5 +30,5 @@
BUFFER='^foo^bar'
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" ./'
expected_region_highlight=(
"1 5 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # 'foo2"'
"7 8 $ZSH_HIGHLIGHT_STYLES[path]" # './'
"1 5 ${(q-)ZSH_HIGHLIGHT_STYLES[double-quoted-argument]}" # 'foo2"'
"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'
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'
expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ps
"4 6 $ZSH_HIGHLIGHT_STYLES[default]" # aux
"8 8 $ZSH_HIGHLIGHT_STYLES[default]" # |
"10 13 $ZSH_HIGHLIGHT_STYLES[command]" # grep
"15 18 $ZSH_HIGHLIGHT_STYLES[default]" # java
"20 20 $ZSH_HIGHLIGHT_STYLES[default]" # |
"22 25 $ZSH_HIGHLIGHT_STYLES[command]" # sort
"27 27 $ZSH_HIGHLIGHT_STYLES[default]" # |
"29 32 $ZSH_HIGHLIGHT_STYLES[command]" # uniq
"34 34 $ZSH_HIGHLIGHT_STYLES[default]" # |
"36 39 $ZSH_HIGHLIGHT_STYLES[command]" # tail
"41 41 $ZSH_HIGHLIGHT_STYLES[default]" # |
"43 46 $ZSH_HIGHLIGHT_STYLES[command]" # head
"1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ps
"4 6 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # aux
"8 8 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"10 13 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # grep
"15 18 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # java
"20 20 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"22 25 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # sort
"27 27 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"29 32 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # uniq
"34 34 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"36 39 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # tail
"41 41 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # |
"43 46 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # head
)

View File

@ -31,5 +31,5 @@ alias x=command
BUFFER='x ls'
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 *'
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 *'
expected_region_highlight=(
"13 13 $ZSH_HIGHLIGHT_STYLES[default]" # *
"21 21 $ZSH_HIGHLIGHT_STYLES[globbing]" # *
"13 13 ${(q-)ZSH_HIGHLIGHT_STYLES[default]}" # *
"21 21 ${(q-)ZSH_HIGHLIGHT_STYLES[globbing]}" # *
)

View File

@ -37,5 +37,5 @@ path+=( "$PWD"/foo )
BUFFER='bar/testing-issue-228'
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'
expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"4 19 $ZSH_HIGHLIGHT_STYLES[path]" # A/mu\ with\ spaces
"1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"4 19 ${(q-)ZSH_HIGHLIGHT_STYLES[path]}" # A/mu\ with\ spaces
)

View File

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

View File

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

View File

@ -34,6 +34,6 @@ hash -d D=mydir
BUFFER='ls ~D/path-tilde-named.test'
expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"4 27 $ZSH_HIGHLIGHT_STYLES[path]" # ~D/path-tilde-named.test
"1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"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'
expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"4 7 $ZSH_HIGHLIGHT_STYLES[path]" # A/mu
"1 2 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"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'
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
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'
expected_region_highlight=(
"1 1 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"3 9 $ZSH_HIGHLIGHT_STYLES[default]" # not precommand
"11 16 $ZSH_HIGHLIGHT_STYLES[default]" # not unknown-token (since 'zzzzzz' is not a command)
"1 1 ${(q-)ZSH_HIGHLIGHT_STYLES[command]}" # ls
"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)
)

View File

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

View File

@ -32,6 +32,6 @@ ZSH_HIGHLIGHT_STYLES[redirection]=$unused_highlight
BUFFER='<<<foo echo >>&!bar'
expected_region_highlight=(
"1 3 $ZSH_HIGHLIGHT_STYLES[redirection]" # <<<
"13 16 $ZSH_HIGHLIGHT_STYLES[redirection]" # >>&!
"1 3 ${(q-)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'
expected_region_highlight=(
"1 6 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # repeat
"8 10 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "1"
"12 13 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # do
"15 18 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # done
"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
)

View File

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

View File

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

View File

@ -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 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo
"6 8 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -C3
"10 11 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u
"13 21 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser
"23 24 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -i
"26 27 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"29 29 $ZSH_HIGHLIGHT_STYLES[path]" # /
"37 37 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ;, error because empty command
"47 47 $ZSH_HIGHLIGHT_STYLES[unknown-token]" # ;, error because incomplete command
"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
)

View File

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

View File

@ -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 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo
"6 7 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u
"9 9 $ZSH_HIGHLIGHT_STYLES[redirection]" # >
"10 13 $ZSH_HIGHLIGHT_STYLES[path]" # /tmp
"15 23 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser
"25 26 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"27 27 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ;
"29 32 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo
"34 35 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"36 36 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ;
"38 41 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo
"43 44 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -i
"46 47 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"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
)

View File

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

View File

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

View File

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

View File

@ -31,5 +31,5 @@ ZSH_HIGHLIGHT_STYLES[command]=$unused_highlight
BUFFER='\sh'
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'
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'
expected_region_highlight=(
"2 5 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo
"7 9 $ZSH_HIGHLIGHT_STYLES[default]" # baz
"10 10 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # semicolon
"12 15 $ZSH_HIGHLIGHT_STYLES[builtin]" # echo
"17 19 $ZSH_HIGHLIGHT_STYLES[default]" # qux
"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
)

View File

@ -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]" != "$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"
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"
continue 2
fi
done