public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH] t1420: use test helpers for lost-found checks
@ 2026-01-11 14:38 Pushkar Singh
  2026-01-11 14:50 ` Pushkar Singh
  0 siblings, 1 reply; 2+ messages in thread
From: Pushkar Singh @ 2026-01-11 14:38 UTC (permalink / raw)
  To: git

The lost-found test used raw `test -f` and `ls | wc -l` checks.
Replace them with `test_path_is_file` and `test_line_count` to provide
clearer failure diagnostics and keep the test consistent with the
rest of the test suite.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail•com>
---
 t/t1420-lost-found.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/t1420-lost-found.sh b/t/t1420-lost-found.sh
index 2fb2f44f02..da1e48d35e 100755
--- a/t/t1420-lost-found.sh
+++ b/t/t1420-lost-found.sh
@@ -28,9 +28,10 @@ test_expect_success 'lost and found something' '
 	test_tick &&
 	git reset --hard HEAD^ &&
 	git fsck --lost-found &&
-	test 2 = $(ls .git/lost-found/*/* | wc -l) &&
-	test -f .git/lost-found/commit/$(cat lost-commit) &&
-	test -f .git/lost-found/other/$(cat lost-other)
+	ls .git/lost-found/*/* >actual &&
+	test_line_count = 2 actual &&
+	test_path_is_file .git/lost-found/commit/$(cat lost-commit) &&
+	test_path_is_file .git/lost-found/other/$(cat lost-other)
 '
 
 test_done
-- 
2.43.0


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

* Re: [PATCH] t1420: use test helpers for lost-found checks
  2026-01-11 14:38 [PATCH] t1420: use test helpers for lost-found checks Pushkar Singh
@ 2026-01-11 14:50 ` Pushkar Singh
  0 siblings, 0 replies; 2+ messages in thread
From: Pushkar Singh @ 2026-01-11 14:50 UTC (permalink / raw)
  To: git

I noticed that this test is already being worked on and reviewed in
another thread. I’ll drop this patch to avoid duplication.

Thanks,
Pushkar

On Sun, Jan 11, 2026 at 8:09 PM Pushkar Singh
<pushkarkumarsingh1970@gmail•com> wrote:
>
> The lost-found test used raw `test -f` and `ls | wc -l` checks.
> Replace them with `test_path_is_file` and `test_line_count` to provide
> clearer failure diagnostics and keep the test consistent with the
> rest of the test suite.
>
> Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail•com>
> ---
>  t/t1420-lost-found.sh | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/t/t1420-lost-found.sh b/t/t1420-lost-found.sh
> index 2fb2f44f02..da1e48d35e 100755
> --- a/t/t1420-lost-found.sh
> +++ b/t/t1420-lost-found.sh
> @@ -28,9 +28,10 @@ test_expect_success 'lost and found something' '
>         test_tick &&
>         git reset --hard HEAD^ &&
>         git fsck --lost-found &&
> -       test 2 = $(ls .git/lost-found/*/* | wc -l) &&
> -       test -f .git/lost-found/commit/$(cat lost-commit) &&
> -       test -f .git/lost-found/other/$(cat lost-other)
> +       ls .git/lost-found/*/* >actual &&
> +       test_line_count = 2 actual &&
> +       test_path_is_file .git/lost-found/commit/$(cat lost-commit) &&
> +       test_path_is_file .git/lost-found/other/$(cat lost-other)
>  '
>
>  test_done
> --
> 2.43.0
>

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

end of thread, other threads:[~2026-01-11 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-11 14:38 [PATCH] t1420: use test helpers for lost-found checks Pushkar Singh
2026-01-11 14:50 ` Pushkar Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox