X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=t%2Ft0040-parse-options.sh;h=007f39d5e1dca6eff7e01969282c4cf2dc1bb57a;hb=d190a0875ff0f33d60a4d7265f2098b35d162f68;hp=ae266147b6db9e06abeb4dc30e4271b6c611deac;hpb=a613b534bca2d56f2ad67b3a7f0cf2b34f031260;p=git.git diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index ae266147b..007f39d5e 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 @@ -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