sudo: Extend test to cover all codepaths.

This commit is contained in:
Daniel Shahaf 2015-10-27 05:09:13 +00:00
parent 7d45f3e3ec
commit 871af68082

View file

@ -28,12 +28,18 @@
# ------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=$unused_highlight ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=$unused_highlight
BUFFER='sudo -u otheruser ls /' # Tests three codepaths:
# * -i (no argument)
# * -C3 (pasted argument)
# * -u otheruser (non-pasted argument)
BUFFER='sudo -C3 -u otheruser -i ls /'
expected_region_highlight=( expected_region_highlight=(
"1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo "1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo
"6 7 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u "6 8 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -C3
"9 17 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser "10 11 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u
"19 20 $ZSH_HIGHLIGHT_STYLES[command]" # ls "13 21 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser
"22 22 $ZSH_HIGHLIGHT_STYLES[path]" # / "23 24 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -i
"26 27 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"29 29 $ZSH_HIGHLIGHT_STYLES[path]" # /
) )