]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t0040-parse-options.sh
test-dir-iterator: do not assume errno values
[thirdparty/git.git] / t / t0040-parse-options.sh
index 800b3ea5f5b64650efa95bfa05e8f90945966f85..cebc77fab0b254fc2e6f63e7eb68956b2b3dec9c 100755 (executable)
@@ -48,6 +48,12 @@ Standard options
     -q, --quiet           be quiet
     --expect <string>     expected output in the variable dump
 
+Alias
+    -A, --alias-source <string>
+                          get a string
+    -Z, --alias-target <string>
+                          get a string
+
 EOF
 
 test_expect_success 'test help' '
@@ -224,6 +230,17 @@ test_expect_success 'non ambiguous option (after two options it abbreviates)' '
        test-tool parse-options --expect="string: 123" --st 123
 '
 
+test_expect_success 'Alias options do not contribute to abbreviation' '
+       test-tool parse-options --alias-source 123 >output &&
+       grep "^string: 123" output &&
+       test-tool parse-options --alias-target 123 >output &&
+       grep "^string: 123" output &&
+       test_must_fail test-tool parse-options --alias &&
+       GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=false \
+       test-tool parse-options --alias 123 >output &&
+       grep "^string: 123" output
+'
+
 cat >typo.err <<\EOF
 error: did you mean `--boolean` (with two dashes ?)
 EOF