X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft0040-parse-options.sh;h=007f39d5e1dca6eff7e01969282c4cf2dc1bb57a;hb=7c10882c0d299b5d1dbe2c633e95c91ca6152197;hp=ae266147b6db9e06abeb4dc30e4271b6c611deac;hpb=5329c99795e187b36a527baa883efe5c3dc2f98c;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