git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t1420: use test helpers for lost-found checks

From
Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Date
Jan 11, 2026, 14:38 UTC
Message-ID
<20260111143928.37604-1-pushkarkumarsingh1970@gmail.com>

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: Pushkar Singh
Message 1 of 2 in “t1420: use test helpers for lost-found checks”
  1. t1420: use test helpers for lost-found checksPushkar Singh, Jan 11, 2026
  2. Pushkar SinghJan 11, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.