summaryrefslogtreecommitdiff
path: root/t/t9902-completion.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-28 19:53:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-28 19:53:32 (GMT)
commit6da2d9595161441cbed1b1f579b8dd46970a8e20 (patch)
tree1bde41b69722ae519ed4c29709e6c3f0dc87d1a6 /t/t9902-completion.sh
parent5eb8da850860839bdf38ab80079eb8875b764431 (diff)
parentb221b5ab9b92f3def37184db6e052ec87d7635b4 (diff)
downloadgit-6da2d9595161441cbed1b1f579b8dd46970a8e20.zip
git-6da2d9595161441cbed1b1f579b8dd46970a8e20.tar.gz
git-6da2d9595161441cbed1b1f579b8dd46970a8e20.tar.bz2
Merge branch 'nd/completion-negation'
Continuing with the idea to programmatically enumerate various pieces of data required for command line completion, the codebase has been taught to enumerate options prefixed with "--no-" to negate them. * nd/completion-negation: completion: collapse extra --no-.. options completion: suppress some -no- options parse-options: option to let --git-completion-helper show negative form
Diffstat (limited to 't/t9902-completion.sh')
-rwxr-xr-xt/t9902-completion.sh41
1 files changed, 39 insertions, 2 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index a28640c..3b3a7b6 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -501,6 +501,42 @@ test_expect_success '__gitcomp - suffix' '
EOF
'
+test_expect_success '__gitcomp - ignore optional negative options' '
+ test_gitcomp "--" "--abc --def --no-one -- --no-two" <<-\EOF
+ --abc Z
+ --def Z
+ --no-one Z
+ --no-... Z
+ EOF
+'
+
+test_expect_success '__gitcomp - ignore/narrow optional negative options' '
+ test_gitcomp "--a" "--abc --abcdef --no-one -- --no-two" <<-\EOF
+ --abc Z
+ --abcdef Z
+ EOF
+'
+
+test_expect_success '__gitcomp - ignore/narrow optional negative options' '
+ test_gitcomp "--n" "--abc --def --no-one -- --no-two" <<-\EOF
+ --no-one Z
+ --no-... Z
+ EOF
+'
+
+test_expect_success '__gitcomp - expand all negative options' '
+ test_gitcomp "--no-" "--abc --def --no-one -- --no-two" <<-\EOF
+ --no-one Z
+ --no-two Z
+ EOF
+'
+
+test_expect_success '__gitcomp - expand/narrow all negative options' '
+ test_gitcomp "--no-o" "--abc --def --no-one -- --no-two" <<-\EOF
+ --no-one Z
+ EOF
+'
+
test_expect_success '__gitcomp - doesnt fail because of invalid variable name' '
__gitcomp "$invalid_variable_name"
'
@@ -1398,8 +1434,8 @@ test_expect_success 'double dash "git checkout"' '
--ignore-other-worktrees Z
--recurse-submodules Z
--progress Z
- --no-track Z
- --no-recurse-submodules Z
+ --no-quiet Z
+ --no-... Z
EOF
'
@@ -1607,6 +1643,7 @@ test_expect_success 'completion used <cmd> completion for alias: !f() { : git <c
test_expect_success 'completion without explicit _git_xxx function' '
test_completion "git version --" <<-\EOF
--build-options Z
+ --no-build-options Z
EOF
'