From: Pushkar Singh <pushkarkumarsingh1970@gmail•com>
To: git@vger•kernel.org
Subject: [PATCH] t1420: use test helpers for lost-found checks
Date: Sun, 11 Jan 2026 14:38:33 +0000 [thread overview]
Message-ID: <20260111143928.37604-1-pushkarkumarsingh1970@gmail.com> (raw)
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
next reply other threads:[~2026-01-11 14:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-11 14:38 Pushkar Singh [this message]
2026-01-11 14:50 ` [PATCH] t1420: use test helpers for lost-found checks Pushkar Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260111143928.37604-1-pushkarkumarsingh1970@gmail.com \
--to=pushkarkumarsingh1970@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox