mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-12-08 15:32:31 +01:00
Refactor to remove prev cmd function and simplify escaping
This commit is contained in:
parent
c5f57da2b8
commit
011d8bdfd1
6 changed files with 20 additions and 48 deletions
|
|
@ -64,6 +64,16 @@ assertSquareBracketsSuggestion() {
|
|||
'echo "$history[123]"'
|
||||
}
|
||||
|
||||
assertHashSuggestion() {
|
||||
set_history <<-'EOF'
|
||||
echo "#yolo"
|
||||
EOF
|
||||
|
||||
assertSuggestion \
|
||||
'echo "#' \
|
||||
'echo "#yolo"'
|
||||
}
|
||||
|
||||
testSpecialCharsForAllStrategies() {
|
||||
local strategies
|
||||
strategies=(
|
||||
|
|
|
|||
|
|
@ -43,30 +43,4 @@ testEscapeCommand() {
|
|||
"$(_zsh_autosuggest_escape_command '?')"
|
||||
}
|
||||
|
||||
testPrevCommand() {
|
||||
set_history <<-'EOF'
|
||||
ls foo
|
||||
ls bar
|
||||
ls baz
|
||||
EOF
|
||||
|
||||
assertEquals \
|
||||
'Did not output the last command' \
|
||||
'ls baz' \
|
||||
"$(_zsh_autosuggest_prev_command)"
|
||||
|
||||
set_history <<-'EOF'
|
||||
ls foo
|
||||
ls bar
|
||||
ls baz
|
||||
ls quux
|
||||
ls foobar
|
||||
EOF
|
||||
|
||||
assertEquals \
|
||||
'Did not output the last command' \
|
||||
'ls foobar' \
|
||||
"$(_zsh_autosuggest_prev_command)"
|
||||
}
|
||||
|
||||
run_tests "$0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue