Code

upload-pack: Use finish_{command,async}() instead of waitpid().
[git.git] / t / t0040-parse-options.sh
index 8e4d74b2005b4c55eefc460d47ed121f664b85f5..ae49424aa02a37df1b00813aa1478d570020c66b 100755 (executable)
@@ -67,4 +67,27 @@ test_expect_success 'intermingled arguments' '
        git diff expect output
 '
 
+cat > expect << EOF
+boolean: 0
+integer: 2
+string: (not set)
+EOF
+
+test_expect_success 'unambiguously abbreviated option' '
+       test-parse-options --int 2 --boolean --no-bo > output 2> output.err &&
+       test ! -s output.err &&
+       git diff expect output
+'
+
+test_expect_success 'unambiguously abbreviated option with "="' '
+       test-parse-options --int=2 > output 2> output.err &&
+       test ! -s output.err &&
+       git diff expect output
+'
+
+test_expect_failure 'ambiguously abbreviated option' '
+       test-parse-options --strin 123;
+        test $? != 129
+'
+
 test_done