git-am foreign patch support: StGIT support
[gitweb.git] / t / t0040-parse-options.sh
index 9054ed6030b35ca3745f666539735139e1dc8720..a40c1236c0862da4d77231bf9255b499ccddd99f 100755 (executable)
@@ -30,6 +30,8 @@ String options
 
 Magic arguments
     --quux                means --quux
+    -NUM                  set integer to NUM
+    +                     same as -b
 
 Standard options
     --abbrev[=<n>]        use <n> digits to display SHA-1s
@@ -275,4 +277,27 @@ test_expect_success 'OPT_NEGBIT() works' '
        test_cmp expect output
 '
 
+test_expect_success 'OPT_BOOLEAN() with PARSE_OPT_NODASH works' '
+       test-parse-options + + + + + + > output 2> output.err &&
+       test ! -s output.err &&
+       test_cmp expect output
+'
+
+cat > expect <<EOF
+boolean: 0
+integer: 12345
+timestamp: 0
+string: (not set)
+abbrev: 7
+verbose: 0
+quiet: no
+dry run: no
+EOF
+
+test_expect_success 'OPT_NUMBER_CALLBACK() works' '
+       test-parse-options -12345 > output 2> output.err &&
+       test ! -s output.err &&
+       test_cmp expect output
+'
+
 test_done