zsh-autosuggestions/test/strategies/default_test.zsh

57 lines
583 B
Bash
Raw Permalink Normal View History

2016-03-06 04:53:07 +01:00
#!/usr/bin/env zsh
source "${0:a:h}/../test_helper.zsh"
oneTimeSetUp() {
source_autosuggestions
}
testNoMatch() {
set_history <<-'EOF'
ls foo
ls bar
EOF
assertSuggestion \
'foo' \
''
assertSuggestion \
'ls q' \
''
}
testBasicMatches() {
set_history <<-'EOF'
ls foo
ls bar
EOF
assertSuggestion \
'ls f' \
'ls foo'
assertSuggestion \
'ls b' \
'ls bar'
}
testMostRecentMatch() {
set_history <<-'EOF'
ls foo
cd bar
ls baz
cd quux
EOF
assertSuggestion \
'ls' \
'ls baz'
assertSuggestion \
'cd' \
'cd quux'
}
run_tests "$0"