Skip to content

Commit e58a1b7

Browse files
committed
tests: Add check for complete function using compopt for options
1 parent af3792b commit e58a1b7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test-bash-completions-getter.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,15 @@ function foo_complete_function() {
141141

142142
complete -F foo_complete_function foo-with-function
143143
check_completion 'foo-with-function pre-word word' "-c -D efgh"
144+
145+
function foo_complete_function_with_options() {
146+
EXPECTED_COMPLETE_PROGRAM=foo-with-function-and-options
147+
EXPECTED_COMPLETE_WORD="'word'"
148+
EXPECTED_COMPLETE_PRE_WORD="'pre-word'"
149+
TEST_COMPLETE_REPLY=(-c -D efgh)
150+
compopt -o default +o default +o bar -o nosort -o nospace +o nospace -o nospace
151+
test_complete_function "$@"
152+
}
153+
154+
complete -F foo_complete_function_with_options foo-with-function-and-options
155+
check_completion 'foo-with-function-and-options pre-word word' "-c -D efgh" "nosort nospace"

0 commit comments

Comments
 (0)