X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft0040-parse-options.sh;h=a1e4616febe6c67f67ab2b4380610abc92468ba5;hb=38ca63f3c0ef70ba4e41d3b5e347e2c7e7d67fe5;hp=ae266147b6db9e06abeb4dc30e4271b6c611deac;hpb=43176d1e4cddc4ab2f2f7dc6f3ba10513ffc2f2b;p=git.git diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index ae266147b..a1e4616fe 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -28,6 +28,7 @@ String options --st get another string (pervert ordering) -o get another string --default-string set string to default + --list add str to list Magic arguments --quux means --quux @@ -86,7 +87,7 @@ EOF test_expect_success 'long options' ' test-parse-options --boolean --integer 1729 --boolean --string2=321 \ --verbose --verbose --no-dry-run --abbrev=10 --file fi.le\ - > output 2> output.err && + --obsolete > output 2> output.err && test ! -s output.err && test_cmp expect output ' @@ -337,4 +338,20 @@ test_expect_success 'negation of OPT_NONEG flags is not ambiguous' ' test_cmp expect output ' +cat >>expect <<'EOF' +list: foo +list: bar +list: baz +EOF +test_expect_success '--list keeps list of strings' ' + test-parse-options --list foo --list=bar --list=baz >output && + test_cmp expect output +' + +test_expect_success '--no-list resets list' ' + test-parse-options --list=other --list=irrelevant --list=options \ + --no-list --list=foo --list=bar --list=baz >output && + test_cmp expect output +' + test_done