All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] t5300: fix test_with_bad_commit()
@ 2024-03-15  4:57 John Cai via GitGitGadget
  2024-03-15 17:07 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: John Cai via GitGitGadget @ 2024-03-15  4:57 UTC (permalink / raw)
  To: git; +Cc: szeder.dev, John Cai, John Cai

From: John Cai <johncai86@gmail.com>

0f8edf7317 (index-pack: --fsck-objects to take an optional argument for
fsck msgs, 2024-02-01) added a test function test_with_bad_commit() that
contained two bugs. test_expect_fail was used instead of test_must_fail,
and a && was not included at the end of the line.

Fix these two issues in the test.

Signed-off-by: John Cai <johncai86@gmail.com>
---
    t5300: fix test_with_bad_commit()
    
    0f8edf7317 (index-pack: --fsck-objects to take an optional argument for
    fsck msgs, 2024-02-01) added a test function test_with_bad_commit() that
    contained two bugs. test_expect_fail was used instead of test_must_fail,
    and a && was not included at the end of the line.
    
    Fix these two issues in the test.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1688%2Fjohn-cai%2Fjc%2Ffix-t5300-tests-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1688/john-cai/jc/fix-t5300-tests-v1
Pull-Request: https://github.com/git/git/pull/1688

 t/t5300-pack-object.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index a58f91035d1..61e2be2903d 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -465,7 +465,7 @@ test_with_bad_commit () {
 	must_pass_arg="$2" &&
 	(
 		cd strict &&
-		test_expect_fail git index-pack "$must_fail_arg" "test-$(cat pack-name).pack"
+		test_must_fail git index-pack "$must_fail_arg" "test-$(cat pack-name).pack" &&
 		git index-pack "$must_pass_arg" "test-$(cat pack-name).pack"
 	)
 }

base-commit: e09f1254c54329773904fe25d7c545a1fb4fa920
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] t5300: fix test_with_bad_commit()
  2024-03-15  4:57 [PATCH] t5300: fix test_with_bad_commit() John Cai via GitGitGadget
@ 2024-03-15 17:07 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2024-03-15 17:07 UTC (permalink / raw)
  To: John Cai via GitGitGadget; +Cc: git, szeder.dev, John Cai

"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: John Cai <johncai86@gmail.com>
>
> 0f8edf7317 (index-pack: --fsck-objects to take an optional argument for
> fsck msgs, 2024-02-01) added a test function test_with_bad_commit() that
> contained two bugs. test_expect_fail was used instead of test_must_fail,
> and a && was not included at the end of the line.
>
> Fix these two issues in the test.

Wow.  This is an embarrassing one.  Thanks for a fix.

> Signed-off-by: John Cai <johncai86@gmail.com>
> ---
>     t5300: fix test_with_bad_commit()
>     
>     0f8edf7317 (index-pack: --fsck-objects to take an optional argument for
>     fsck msgs, 2024-02-01) added a test function test_with_bad_commit() that
>     contained two bugs. test_expect_fail was used instead of test_must_fail,
>     and a && was not included at the end of the line.
>     
>     Fix these two issues in the test.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1688%2Fjohn-cai%2Fjc%2Ffix-t5300-tests-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1688/john-cai/jc/fix-t5300-tests-v1
> Pull-Request: https://github.com/git/git/pull/1688
>
>  t/t5300-pack-object.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
> index a58f91035d1..61e2be2903d 100755
> --- a/t/t5300-pack-object.sh
> +++ b/t/t5300-pack-object.sh
> @@ -465,7 +465,7 @@ test_with_bad_commit () {
>  	must_pass_arg="$2" &&
>  	(
>  		cd strict &&
> -		test_expect_fail git index-pack "$must_fail_arg" "test-$(cat pack-name).pack"
> +		test_must_fail git index-pack "$must_fail_arg" "test-$(cat pack-name).pack" &&
>  		git index-pack "$must_pass_arg" "test-$(cat pack-name).pack"
>  	)
>  }
>
> base-commit: e09f1254c54329773904fe25d7c545a1fb4fa920

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-15 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-15  4:57 [PATCH] t5300: fix test_with_bad_commit() John Cai via GitGitGadget
2024-03-15 17:07 ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.