diff options
Diffstat (limited to 't/t0040-parse-options.sh')
-rwxr-xr-x | t/t0040-parse-options.sh | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index 65606df3ed..b044785175 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -30,7 +30,6 @@ String options --string2 <str> get another string --st <st> get another string (pervert ordering) -o <str> get another string - --default-string set string to default --list <str> add str to list Magic arguments @@ -173,12 +172,9 @@ test_expect_success 'long options' ' ' test_expect_success 'missing required value' ' - test-parse-options -s; - test $? = 129 && - test-parse-options --string; - test $? = 129 && - test-parse-options --file; - test $? = 129 + test_expect_code 129 test-parse-options -s && + test_expect_code 129 test-parse-options --string && + test_expect_code 129 test-parse-options --file ' cat > expect << EOF @@ -228,8 +224,7 @@ test_expect_success 'unambiguously abbreviated option with "="' ' ' test_expect_success 'ambiguously abbreviated option' ' - test-parse-options --strin 123; - test $? = 129 + test_expect_code 129 test-parse-options --strin 123 ' cat > expect << EOF @@ -293,7 +288,7 @@ cat > expect <<EOF boolean: 0 integer: 0 timestamp: 1 -string: default +string: (not set) abbrev: 7 verbose: 0 quiet: yes @@ -302,8 +297,8 @@ file: (not set) arg 00: foo EOF -test_expect_success 'OPT_DATE() and OPT_SET_PTR() work' ' - test-parse-options -t "1970-01-01 00:00:01 +0000" --default-string \ +test_expect_success 'OPT_DATE() works' ' + test-parse-options -t "1970-01-01 00:00:01 +0000" \ foo -q > output 2> output.err && test_must_be_empty output.err && test_cmp expect output |