🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #759

[PATCH v3] [Outreachy PATCH] t2030: modernize test path checks

#759
From: "Srujith A Poojary via GitGitGad...
Date: Sun, 18 Oct 2026 05:05
98 lines
12234 bytes
From: Srujith Poojary <poojarysrujith@gmail.com>

Replace old-style file checks with test_path_is_file and the helper

test_path_is_missing for clearer failure diagnostics in test output.

Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
---
    t2030: modernize test path checks

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2256%2Fpoojarysrujith%2Fmicroproject-modernize-path-check-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2256/poojarysrujith/microproject-modernize-path-check-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/2256

Range-diff vs v2:

 1:  93cf6c12f4 ! 1:  75086e1db0 [Outreachy PATCH] t2030: modernize test path checks
     @@ Commit message
      
          test_path_is_missing for clearer failure diagnostics in test output.
      
     -    Search with: git grep "test -[efd]" t/
     -
          Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
      
       ## t/t2030-unresolve-info.sh ##
     @@ t/t2030-unresolve-info.sh: test_expect_success 'rerere and rerere forget' '
       	tr "\0" "\n" <.git/MERGE_RR >actual &&
       	echo "$rerere_id	fi/le" >expect &&
       	test_cmp expect actual
     +@@ t/t2030-unresolve-info.sh: test_expect_success 'rerere and rerere forget (subdirectory)' '
     + 	(cd fi && git rerere) &&
     + 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
     + 	rerere_id=${rerere_id%/postimage} &&
     +-	test -f .git/rr-cache/$rerere_id/postimage &&
     ++	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
     + 	(cd fi && git checkout -m le) &&
     + 	echo resurrect the conflict &&
     + 	test_grep "^=======" fi/le &&
     +@@ t/t2030-unresolve-info.sh: test_expect_success 'rerere and rerere forget (subdirectory)' '
     + 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
     + 	test -z "$(git ls-files -u)" &&
     + 	(cd fi && git rerere forget le) &&
     +-	! test -f .git/rr-cache/$rerere_id/postimage &&
     ++	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
     + 	tr "\0" "\n" <.git/MERGE_RR >actual &&
     + 	echo "$rerere_id	fi/le" >expect &&
     + 	test_cmp expect actual


 t/t2030-unresolve-info.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 9af24b1204..f6f5dd7cb8 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -170,7 +170,7 @@ test_expect_success 'rerere and rerere forget' '
 	git rerere &&
 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
 	rerere_id=${rerere_id%/postimage} &&
-	test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
 	git checkout -m fi/le &&
 	echo resurrect the conflict &&
 	test_grep "^=======" fi/le &&
@@ -182,7 +182,7 @@ test_expect_success 'rerere and rerere forget' '
 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
 	test -z "$(git ls-files -u)" &&
 	git rerere forget fi/le &&
-	! test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
 	tr "\0" "\n" <.git/MERGE_RR >actual &&
 	echo "$rerere_id	fi/le" >expect &&
 	test_cmp expect actual
@@ -196,7 +196,7 @@ test_expect_success 'rerere and rerere forget (subdirectory)' '
 	(cd fi && git rerere) &&
 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
 	rerere_id=${rerere_id%/postimage} &&
-	test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
 	(cd fi && git checkout -m le) &&
 	echo resurrect the conflict &&
 	test_grep "^=======" fi/le &&
@@ -208,7 +208,7 @@ test_expect_success 'rerere and rerere forget (subdirectory)' '
 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
 	test -z "$(git ls-files -u)" &&
 	(cd fi && git rerere forget le) &&
-	! test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
 	tr "\0" "\n" <.git/MERGE_RR >actual &&
 	echo "$rerere_id	fi/le" >expect &&
 	test_cmp expect actual

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- 
gitgitgadget
Technical Details
Message-ID: <pull.2256.v3.git.1792299943380.gitgitgadget@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72330-linux-kernel-git=dewy.ru
References: <pull.2256.git.1791978767497.gitgitgadget@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72330-linux-kernel-git=dewy.ru
From: gitgitgadget@gmail.com ("Srujith A Poojary via GitGitGadget")
Newsgroups: linux.kernel.git
Subject: [PATCH v3] [Outreachy PATCH] t2030: modernize test path checks
Date: Sun, 18 Oct 2026 05:05:43 +0000
Organization: Usenet Network
Message-ID: <pull.2256.v3.git.1792299943380.gitgitgadget@gmail.com>
References: <pull.2256.git.1791978767497.gitgitgadget@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3233207"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:hYw/6tw5llc5YmP+/43fRMUsddw= sha256:n51tobZ1sAA1jo4JFloGiUF/zmxWlPKPfBYJfytsocQ=
	sha1:rsUlVaBL1pvGkYxwW/uSN4bf2/U= sha256:mMepW1mS0qWEg9kCmWxhkp6qjZzIevxxNfiwy5h4Oeo=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id EDBF9125A3F; Sun, 18 Oct 2026 08:06:10 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 0.511
X-Spam-Status: No, score=0.511 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_SBL_CSS=3.558,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001]
	autolearn=no autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id kVTdB39-qX4G;
	Sun, 18 Oct 2026 08:06:07 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-72330-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 766A5DF0B6; Sun, 18 Oct 2026 08:05:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 08573382AB; Sun, 18 Oct 2026 05:05:49 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 79C7A3AAF5B;
	Sun, 18 Oct 2026 05:05:48 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GxFNTpKr"
X-Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F3123955CB
	for <git@vger.kernel.org>; Sun, 18 Oct 2026 05:05:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.178
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792299947; cv=none; b=QNWZdoGAU9Qr1OGc/EQbpsTJE4rY7rPfMhHiYTr4Vc+FfJyDuA14CVu/sUaLPalHIO5+IrryE/GGpnLsM0kx/sq+YQQrEyEWOXGLY2PIC9xOaOHpPAIYcJRygdgwasvX2ZuL2RzMa1TtcwdQZ0aDBl5U5IBQHeZedyyc3hTtPtY=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792299947; c=relaxed/simple;
	bh=GhvrTD8yuVPuc6Uve+e19bdSFNHcdiC4V+asgZy+xoQ=;
	h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type:
	 MIME-Version:To:Cc; b=f3BEcFyiwBTuwXoqm2ZKVkaqkp0WElfPVmR+6CzcJjHWwJzoiPZ8kJaddDzjfg7o4sxag/c+NJzTbIwWNIhkcJJAP8LdMdZfkWYMdjh+HDGIrUSvHTmZgp/5QjpDljmStM3XqytGpe5O977/01xvEQ4sSL32ptU/fdsZ6y13/Is=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GxFNTpKr; arc=none smtp.client-ip=74.125.82.178
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f178.google.com with SMTP id 5a478bee46e88-35ef6b49813so2156744eec.0
        for <git@vger.kernel.org>; Sat, 17 Oct 2026 22:05:46 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792299945; x=1792904745; darn=vger.kernel.org;
        h=cc:to:mime-version:content-transfer-encoding:content-type:fcc
         :subject:date:from:references:in-reply-to:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=rf0BBZGvtd7v2fBEEuD+D110G6LcweqiLNq/pPqst1c=;
        b=GxFNTpKrq/lgQpZSGWywE4lGMHV6sKK+SneIm0bsGS8PcGz+AyECsq8ex7KC/g+FMn
         JTilWtvBjqkQyPtEr3Ge6LYEevKq1yuawIMQmlC6MIto8OJoh2c51V7hzl5eUAgn/mjt
         d5qC6AF5BwxFWkqIpd1J0c9e87ke/1ZF/HbUkNyA/e1ki0gD/v42scFOkyZ64aqHfK+C
         LZ7S9NadcEVnURTQfQrOetAXmrv41qAyTmIJaBIDCEd9r7rko6WLrYtXc3YPtk0wUTi0
         NLWpA8XioeNbnYnFAaDhwtFnTeAJFwIJ6n9KvRWevRKYXupOhkafoAMipCOWwSBIfvJe
         yQiQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792299945; x=1792904745;
        h=cc:to:mime-version:content-transfer-encoding:content-type:fcc
         :subject:date:from:references:in-reply-to:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=rf0BBZGvtd7v2fBEEuD+D110G6LcweqiLNq/pPqst1c=;
        b=mgDaFWa3DNu0ToMZ47pFA5UKAAAWG7jzAJpvrX5mIInFk/j3gERdQCUnnUoXqn6o/2
         leTJ5DCBjgq/rEN7Xc+KvBffkVQHGxqq/3MPDaOCBGtYQIStEYbrFWO8PYSPkEdJTkiH
         nP1TzIFa1dqkxdEMOZHrmHwQB/jg3wuyh5aenFFPaMqqeukG2s9L71WqPvubD6NzWGNr
         Z2R1thDRxTQl4aS3h1bOdX78CeaqaS7reyRNTF4x9V0RwWTVNm32RmfaE6SVcSUjOfU/
         ZlX6+kDU7xqe3sczYKryZXWVv98f578HTv5wNuKDesCCZnEkKG2lGJd+LjxD3A9cIGgW
         kTIw==
X-Gm-Message-State: AFq9FYLSNNOdCjoCMDMtIdsau/fogsbIPRT1r+vZXKZOua8yx9lEeYqO
	TX2cmlSpWJIhnAwU7bXV79VmD2WP9NtolkCBIohaDngrxmEi1YqrplSXsWbSzQ==
X-Gm-Gg: AYBFou3dp4qBjjuraLVz8AzNnTWD2LFK7O5Zt+fqqee8U2atpoJugi9vup5UatuwKPO
	bfSKjKdHQo5s30jslZxlFgJmgjpPJu1TTO7T5IGI3itNk96cG7n5pLQAQMWRjM4/L7XKfDi5VTd
	/QzpfaWMc0EX29PULj7cElGTJffEKexXtVpTEyfEeS0iGUYfyogc7TpgavU6XrNT7ZxoAznvggr
	yv7diR32ybUuuzEEwEAmax6XmZdpRGrGHidvRDXfq8Td8sWMx7lAFYUY++lqgTHLmPH5v7W1JwH
	wlmejk+olNFjVSsocRmvLv36yo83HLc72XNhkzwvSqixlQL6dMB756oaiyEV9lfhfr+ULeGo6n7
	QXiTtGUwWvXohXsulTezDJEtEN4+fVgDQMFfjrvBtSbDcS2OJtyregDNiPfQxPsYFtpRNH1F8Mf
	CyUPBJVyBE600UvkJjTyd9H+axTrWwyKmcLNVo6rW/wkqDyBjJDmCrXaBPsHNxF6Kv8SFPejUD
X-Received: by 2002:a05:7301:1884:b0:35a:4ad6:d215 with SMTP id 5a478bee46e88-361a2343db8mr6091415eec.22.1792299945118;
        Sat, 17 Oct 2026 22:05:45 -0700 (PDT)
X-Received: from [127.0.0.1] ([134.33.99.229])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3608308a87csm35115651eec.28.2026.10.17.22.05.43
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sat, 17 Oct 2026 22:05:44 -0700 (PDT)
X-In-Reply-To: <pull.2256.git.1791978767497.gitgitgadget@gmail.com>
X-Fcc: Sent
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-Cc: Harald Nordgren <haraldnordgren@gmail.com>,
    Usman Akinyemi <usmanakinyemi202@gmail.com>,
    Srujith A Poojary <poojarysrujith@gmail.com>,
    Srujith Poojary <poojarysrujith@gmail.com>