dotfiles/zsh/modules/zsh-autosuggestions/test/widgets/execute_test.zsh

27 lines
414 B
Bash
Raw Normal View History

2018-04-05 13:06:54 +02:00
#!/usr/bin/env zsh
source "${0:a:h}/../test_helper.zsh"
oneTimeSetUp() {
source_autosuggestions
}
tearDown() {
restore _zsh_autosuggest_invoke_original_widget
}
testRetval() {
stub_and_eval \
_zsh_autosuggest_invoke_original_widget \
'return 1'
_zsh_autosuggest_widget_execute 'original-widget'
assertEquals \
'Did not return correct value from original widget' \
'1' \
"$?"
}
run_tests "$0"