X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft1502-rev-parse-parseopt.sh;h=3b612c67bec5985b24016eff7916942ae0afb58b;hb=b1f47514f207b0601de7b0936cf13b3c0ae70081;hp=997002d4c40dd8e66e3be5a701e3d99bab1c57c4;hpb=d9d9e6ee6366fed93a4beff3994bad376f81eabd;p=git.git diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh index 997002d4c..3b612c67b 100755 --- a/t/t1502-rev-parse-parseopt.sh +++ b/t/t1502-rev-parse-parseopt.sh @@ -20,8 +20,7 @@ Extras EOF -test_expect_success 'test --parseopt help output' ' - git rev-parse --parseopt -- -h 2> output.err < optionspec << EOF some-command [options] ... some-command does foo and bar! @@ -37,7 +36,65 @@ C? option C with an optional argument Extras extra1 line above used to cause a segfault but no longer does EOF + +test_expect_success 'test --parseopt help output' ' + git rev-parse --parseopt -- -h 2> output.err < optionspec test_cmp expect.err output.err ' +cat > expect < output && + test_cmp expect output +' + +test_expect_success 'test --parseopt with mixed options and arguments' ' + git rev-parse --parseopt -- --foo arg --bar=ham < optionspec > output && + test_cmp expect output +' + +cat > expect < output && + test_cmp expect output +' + +test_expect_success 'test --parseopt --stop-at-non-option' ' + git rev-parse --parseopt --stop-at-non-option -- --foo arg --bar=ham < optionspec > output && + test_cmp expect output +' + +cat > expect < output && + test_cmp expect output +' + +cat >expect <output && + test_cmp expect output +' + +cat > expect <output && + test_cmp expect output +' + test_done