diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2013-04-28 00:09:59 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-28 01:32:28 +0400 |
commit | ddf07bddef9aac37cf54ef744452f2a9ad4e312e (patch) | |
tree | 1a256310afd89fbbc43dc14249adae3a310058f5 /t/t9902-completion.sh | |
parent | b75cdfaa882a00f2274e74b21c1a9927d184ed29 (diff) |
completion: add file completion tests
The commit fea16b4 (git-completion.bash: add support for path
completion) introduced quite a few changes, without the usual tests.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9902-completion.sh')
-rwxr-xr-x | t/t9902-completion.sh | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 6d9d1418a0..385e1e455c 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -347,4 +347,72 @@ test_expect_success 'send-email' ' test_completion "git send-email ma" "master " ' +test_expect_success 'complete files' ' + git init tmp && cd tmp && + test_when_finished "cd .. && rm -rf tmp" && + + echo "expected" > .gitignore && + echo "out" >> .gitignore && + + git add .gitignore && + test_completion "git commit " ".gitignore" && + + git commit -m ignore && + + touch new && + test_completion "git add " "new" && + + git add new && + git commit -a -m new && + test_completion "git add " "" && + + git mv new modified && + echo modify > modified && + test_completion "git add " "modified" && + + touch untracked && + + : TODO .gitignore should not be here && + test_completion "git rm " <<-\EOF && + .gitignore + modified + EOF + + test_completion "git clean " "untracked" && + + : TODO .gitignore should not be here && + test_completion "git mv " <<-\EOF && + .gitignore + modified + EOF + + mkdir dir && + touch dir/file-in-dir && + git add dir/file-in-dir && + git commit -m dir && + + mkdir untracked-dir && + + : TODO .gitignore should not be here && + test_completion "git mv modified " <<-\EOF && + .gitignore + dir + modified + untracked + untracked-dir + EOF + + test_completion "git commit " "modified" && + + : TODO .gitignore should not be here && + test_completion "git ls-files " <<-\EOF + .gitignore + dir + modified + EOF + + touch momified && + test_completion "git add mom" "momified" +' + test_done |