From 6c5c7e7071eeac33139fc7a7c0387bfb981153c2 Mon Sep 17 00:00:00 2001 From: Andrew Chitester Date: Tue, 6 Jan 2026 08:26:58 -0500 Subject: [PATCH] t1420: modernize the lost-found test This test indirectly checks that the lost-found folder has 2 files in it and then checks that the expected two files exist. Make this more deliberate by removing the old test -f and compare the actual ls of the lost-found directory with the expected files. Signed-off-by: Andrew Chitester Signed-off-by: Junio C Hamano --- t/t1420-lost-found.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/t/t1420-lost-found.sh b/t/t1420-lost-found.sh index 2fb2f44f02..926c6d63e3 100755 --- a/t/t1420-lost-found.sh +++ b/t/t1420-lost-found.sh @@ -28,9 +28,12 @@ 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 && + cat >expect <<-EOF && + .git/lost-found/commit/$(cat lost-commit) + .git/lost-found/other/$(cat lost-other) + EOF + test_cmp expect actual ' test_done