]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1502-rev-parse-parseopt.sh
Merge branch 'js/complete-checkout-t' into maint-2.42
[thirdparty/git.git] / t / t1502-rev-parse-parseopt.sh
index 284fe18e7262ae9198d61a34142aa2e82696ce2a..dd811b7fb467c4f3f27ef1be14427e022f73caeb 100755 (executable)
@@ -302,10 +302,17 @@ test_expect_success 'test --parseopt help output: "wrapped" options normal "or:"
        |EOF
        END_EXPECT
 
-       test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
+       test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
        test_cmp expect actual
 '
 
+test_expect_success 'test --parseopt invalid opt-spec' '
+       test_write_lines x -- "=, x" >spec &&
+       echo "fatal: missing opt-spec before option flags" >expect &&
+       test_must_fail git rev-parse --parseopt -- <spec 2>err &&
+       test_cmp expect err
+'
+
 test_expect_success 'test --parseopt help output: multi-line blurb after empty line' '
        sed -e "s/^|//" >spec <<-\EOF &&
        |cmd [--some-option]
@@ -332,7 +339,7 @@ test_expect_success 'test --parseopt help output: multi-line blurb after empty l
        |EOF
        END_EXPECT
 
-       test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
+       test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
        test_cmp expect actual
 '