mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
46 lines
862 B
Bash
46 lines
862 B
Bash
#!/usr/bin/env zsh
|
|
|
|
source "${0:a:h}/test_helper.zsh"
|
|
|
|
oneTimeSetUp() {
|
|
source_autosuggestions
|
|
}
|
|
|
|
testEscapeCommand() {
|
|
assertEquals \
|
|
'Did not escape single backslash' \
|
|
'\\' \
|
|
"$(_zsh_autosuggest_escape_command '\')"
|
|
|
|
assertEquals \
|
|
'Did not escape two backslashes' \
|
|
'\\\\' \
|
|
"$(_zsh_autosuggest_escape_command '\\')"
|
|
|
|
assertEquals \
|
|
'Did not escape parentheses' \
|
|
'\(\)' \
|
|
"$(_zsh_autosuggest_escape_command '()')"
|
|
|
|
assertEquals \
|
|
'Did not escape square brackets' \
|
|
'\[\]' \
|
|
"$(_zsh_autosuggest_escape_command '[]')"
|
|
|
|
assertEquals \
|
|
'Did not escape pipe' \
|
|
'\|' \
|
|
"$(_zsh_autosuggest_escape_command '|')"
|
|
|
|
assertEquals \
|
|
'Did not escape star' \
|
|
'\*' \
|
|
"$(_zsh_autosuggest_escape_command '*')"
|
|
|
|
assertEquals \
|
|
'Did not escape question mark' \
|
|
'\?' \
|
|
"$(_zsh_autosuggest_escape_command '?')"
|
|
}
|
|
|
|
run_tests "$0"
|