Browse Source

sudo: Extend test to cover all codepaths.

pull/232/head
Daniel Shahaf 9 years ago
parent
commit
871af68082
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      highlighters/main/test-data/sudo-command.zsh

+ 11
- 5
highlighters/main/test-data/sudo-command.zsh View File

@ -28,12 +28,18 @@
# -------------------------------------------------------------------------------------------------
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=(
"1 4 $ZSH_HIGHLIGHT_STYLES[precommand]" # sudo
"6 7 $ZSH_HIGHLIGHT_STYLES[single-hyphen-option]" # -u
"9 17 $ZSH_HIGHLIGHT_STYLES[default]" # otheruser
"19 20 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"22 22 $ZSH_HIGHLIGHT_STYLES[path]" # /
"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]" # /
)

Loading…
Cancel
Save