Skip to content

Commit 0e02bdc

Browse files
felipecgitster
authored andcommitted
test: completion: add tests for __git_complete
Even though the function was marked as not public, it's already used in the wild. We should at least test basic functionality. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 810df0e commit 0e02bdc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t9902-completion.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,4 +2380,12 @@ test_expect_success 'sourcing the completion script clears cached --options' '
23802380
verbose test -z "$__gitcomp_builtin_notes_edit"
23812381
'
23822382

2383+
test_expect_success '__git_complete' '
2384+
unset -f __git_wrap__git_main &&
2385+
__git_complete foo __git_main &&
2386+
__git_have_func __git_wrap__git_main &&
2387+
__git_complete gf _git_fetch &&
2388+
__git_have_func __git_wrap_git_fetch
2389+
'
2390+
23832391
test_done

0 commit comments

Comments
 (0)