🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #1810

[PATCH v3] t5300: modernize test path checks in t5300

#1810
From: Ogundipe Sola Taiwo
Date: Thu, 29 Oct 2026 12:02
68 lines
13213 bytes
Replace `test -f` commands with `test_path_is_file`, because
it makes debugging a failing test easier by reporting what
expectation was not met.

Signed-off-by: Ogundipe Sola Taiwo <ogundipesolataiwo12@gmail.com>
---
Changes in v3:
- Rephrase patch summary to state how the use of `test_path_is_file`
	improves the debugging of failing tests.

 t/t5300-pack-object.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index aac139e6a0..e5ce478484 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -283,11 +283,11 @@ test_expect_success 'survive missing objects/pack directory' '
 		GOP=.git/objects/pack &&
 		rm -fr $GOP &&
 		git index-pack --stdin --keep=test <../test-3-${packname_3}.pack &&
-		test -f $GOP/pack-${packname_3}.pack &&
+		test_path_is_file $GOP/pack-${packname_3}.pack &&
 		cmp $GOP/pack-${packname_3}.pack ../test-3-${packname_3}.pack &&
-		test -f $GOP/pack-${packname_3}.idx &&
+		test_path_is_file $GOP/pack-${packname_3}.idx &&
 		cmp $GOP/pack-${packname_3}.idx ../test-3-${packname_3}.idx &&
-		test -f $GOP/pack-${packname_3}.keep
+		test_path_is_file $GOP/pack-${packname_3}.keep
 	)
 '

@@ -376,7 +376,7 @@ test_expect_success 'build pack index for an existing pack' '
 	rm -f test-4.keep &&
 	git index-pack --keep=why test-4.pack &&
 	cmp test-1-${packname_1}.idx test-4.idx &&
-	test -f test-4.keep &&
+	test_path_is_file test-4.keep &&

 	:
 '
@@ -616,7 +616,7 @@ test_expect_success 'setup: fake a SHA1 hash collision' '
 		cd corrupt &&
 		long_a=$(git hash-object -w ../a | sed -e "s!^..!&/!") &&
 		long_b=$(git hash-object -w ../b | sed -e "s!^..!&/!") &&
-		test -f	.git/objects/$long_b &&
+		test_path_is_file .git/objects/$long_b &&
 		cp -f	.git/objects/$long_a \
 			.git/objects/$long_b
 	)

Range-diff against v2:
1:  ca6cd5870e ! 1:  bbce4f6440 t5300: modernize test path checks in t5300
    @@ Metadata
      ## Commit message ##
         t5300: modernize test path checks in t5300

    -    Improves test t5300-pack-object by converting old-style
    -    path checks to use the `test_path_is_file` helper function.
    +    Replace `test -f` commands with `test_path_is_file`, because
    +    it makes debugging a failing test easier by reporting what
    +    expectation was not met.

         Signed-off-by: Ogundipe Sola Taiwo <ogundipesolataiwo12@gmail.com>

--
2.56.0.116.g6de20f6092.dirty
Technical Details
Message-ID: <20261029120210.3722-1-ogundipesolataiwo12@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-73754-linux-kernel-git=dewy.ru
References: <20261023154851.7876-1-ogundipesolataiwo12@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-73754-linux-kernel-git=dewy.ru
From: ogundipesolataiwo12@gmail.com (Ogundipe Sola Taiwo)
Newsgroups: linux.kernel.git
Subject: [PATCH v3] t5300: modernize test path checks in t5300
Date: Thu, 29 Oct 2026 08:02:06 -0400
Organization: Usenet Network
Message-ID: <20261029120210.3722-1-ogundipesolataiwo12@gmail.com>
References: <20261023154851.7876-1-ogundipesolataiwo12@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2001239"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7qDbn5bh1H7xPQ/ILRwydi7OSMc= sha256:TT/29rJlzOQrfkg6mq3dfXfERHUdBKpBT7eUZhQh1Ag=
	sha1:ixXMqNXKm1DAT+oje5xoVZdaJZQ= sha256:aWjVldqY5OGMlkSNwHOEkdSikOzIDeL2l7iLVQU2/Fk=
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 EC363125C66; Thu, 29 Oct 2026 15:02:58 +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 wRsSgvreY7Ld;
	Thu, 29 Oct 2026 15:02:52 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-73754-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 37C48125C63; Thu, 29 Oct 2026 15:02:33 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id EEFCB284D4; Thu, 29 Oct 2026 12:02:29 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793275347;
	b=KFFi8nlRRnq0nRnLc+gCB/uj59lwWiJ6W+KZC6/WgJUvCzwjBjzHUeOalgvQ8MB7UYZ1
	 Ym1VkzoD6Rvf51RIKIhF6ynZ+hUz0eJNJT7eoHrk1r+QOysAnUwe67HXragryFO1lXGPV
	 gCVxgGsXgAzEFxs0er2EEBWv0f6izCvWwQm/TjMfVPge5Ou+nk4RoABtHVdhpBg9Bw8C8
	 v77SbcKKfYTTvP7MH0D4k3nJQGCNTbjJaczIsLJw1AZ05fyij6GxjeajQ4zmU7FmlYgd4
	 iKyNnQcJMozeGA+76oignm00B7VYwZT0Q85Jo2m7Yw99jAidNn6RSDWT2/+Fy+pubdw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793275347;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=0pU/S7dv+kEglJBlDwJyeGQdjUadb/G3jiCLoKjoPTg=;
	b=StiqiLTQynf4R3pTc3VZdJp5Re9WPn8O5wy1IXEV0PZpY0AI1lNYQ+bm6Ts7KrAfxDE2
	 CKrZGvAHtcBLhYBn0c6OuXXxzxnTWuP5Iod6iEMkoVXjP/dGjHBwM1XGnbaYcUFjsd9Jk
	 6r66mo9j81p0E69JXueaEq2V7Cm3pHPfq2oSo0sjUioHSuFNGfn2fJPf4YIIezFTummuD
	 IhPt9KakNl2MA7UHFLLjEjX0SgclusO2lzonQKRq/t/h/6TrOVvZxHYzaH+SlsXMMOyHB
	 pmzVUwBEzisyM9xvvpczzdb5ygJsvYKeM3HwhbxpkfoYXuw1D3al2J6d3OsbfZYlrCA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=NHXiWy+x;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BAFB606A31E;
	Thu, 29 Oct 2026 12:02:27 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=NHXiWy+x
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.47
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793275346;
	b=X+WV7STpah3hbjlg7QCGD3Hz4VuqkDmHSWwh02eJ7ztc+nIbyjdo7V8X6e6JwTJ6cQsH
	 aJmdYGweiRsk6fBbb40cZBDtseEwZjOxKUB8AhChwZOig1uxgI298QZHXKgEBnKxbz8Kr
	 yl1ri9DZDVsvL/lhHDWpWT4Fah2YGJVAapstOpk0azNElm4dwBggAEez/rrn1Jotygl7r
	 MJVC/D/IbZm5CZlUYn31sNF1F6CZ3BgoI8kxk7Nk8VCk6oQqYJO8V7qn9OoUjPmn+7fGA
	 Opl0XacjWvaow/epNTAZiGhQTZBA2WQzvAKCIbt2TFlEJUQEZ5X4exHw8f78Gx02I1g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793275346;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=0pU/S7dv+kEglJBlDwJyeGQdjUadb/G3jiCLoKjoPTg=;
	b=vjjA5ouO0JsG0E/2EWAs1xm8dHlSUnwtpINAwjqcpRCCuZtgJj41/BgmcbKkv3+xcP4V
	 rKCLSMXlxM7gaT2mnlKqeMgyIMYUZFiAaIrx2USJ2yntUd9RCAWnhbFH35W9nm8A+F6i0
	 YY0MQGfV0V7v6H2U3fgjPPMxShbMGf+rxPjYatbd/7Y5p/pHK5+O+CQT8AmhGzELkdenN
	 /AnOMFGwx8QftIcPINNqI9LeyRn0oLkx04JWsphFgj1GiezDT2UppatRe1lv2s8xKTa7P
	 PDdskEXv8E3yxZK5VZYq8C9+sgnng/RY8FIDPzudEuHPH8d8zJYg8PipStIR0+uvZPA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=NHXiWy+x;
	arc=none smtp.remote-ip=209.85.221.47
X-Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EDF5606A31C
	for <git@vger.kernel.org>; Thu, 29 Oct 2026 12:02:26 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5EDF5606A31C
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-wr1-f47.google.com with SMTP id ffacd0b85a97d-48b042c0759so1054040f8f.2
        for <git@vger.kernel.org>; Thu, 29 Oct 2026 05:02:26 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1793275345; x=1793880145; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=0pU/S7dv+kEglJBlDwJyeGQdjUadb/G3jiCLoKjoPTg=;
        b=NHXiWy+xN4WGCl+B697StVBf1WXUYThuH1c8avAB8e7nKGSIG2dE+9nMC8j9HPgJ10
         uWWgGHq2cjNmzHN3ObUbt6NqDHqgvQUySjwjtVqY+Ns+HOXM2I3AIYI4H5lvkqPJdcdD
         HMAuj9zTx6qIQw4R4GBvClwx8jucQvlpO01OtXe5TDQC65whMQewrw4siN1d6hrFyYiN
         jP58eVU9vNi44eAPykehT/z/Z2E6vFY/+YBKuV/DlkZKsswfWk2TKwEYKSnCkqlALAoV
         FuDbRbUUkHgq8b2AY5DOKQuOxYb/HBa0GEz5CYkWfqzJ3aUT9FGRNXzD52mkxTKPN1+t
         dE3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793275345; x=1793880145;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=0pU/S7dv+kEglJBlDwJyeGQdjUadb/G3jiCLoKjoPTg=;
        b=INNgosybKPRXm46MrBXzTNP0z89q+STYIgzHJpDQ8r94NIjWvn/zConcRM07cncJ9i
         Jb0X8SAbKDClaMqORKj60YWlZWrDl05lsjDdz80rf23o41MsuhfUtkCZFz9ipY5L95Uw
         Ix28Xavg6MRNDe99l42NgSti9y3T7f5Wso5jNDW6bT27qfHiE2odaHyJXs6oN4G8yyg5
         i8nDe+A9mcAqwGSdG6RdCIcQq3VpAJ2xGqmb8bJqZJbkxw8NK7PgfAlX3lKn8owdB6g3
         5kNjPappYY6fSuotLdlGxW/RDAgb5FtpKnZr0gKnTUXGQKTmvsKFGBHC28yfiGvzBYhn
         QjWQ==
X-Gm-Message-State: AFq9FYJqhMcR+y4sMAvfcmwic7sMw6XfhZAILM9NbQ7itX33gGU7+qpZ
	jamT0oahFWR2hOrEVhGnjfgf7RRQ+XVdYur3S/hz8fAURHXp7y1OQli4g6CAO7Fj
X-Gm-Gg: AYBFou3YJ1e8ARoari0YyDtGGobAVcSHstGygu+CALoLMjYaB1y+0OvfoN8JnVgi9bY
	4yoraS3/fnLwiOVWFNLC10I5srMtUAfchht86bIEAKop3CwVGQUOWleglmU1H2WtdwXdSQzAC3d
	otrm6thRsUHofftpQQZsJteULrLSJ2jvu1DdyzER/AmT21AlYR5rPTYOqYtcPbWHp22DFuySNRA
	GgJBe04oh8JHh5LPD5nDQzeQ21qflxBK4m384hdD2YSPfyLQBSoWgc8tpSy+l/Ezotmt15fL3oM
	uxzGEsr4qhjIIQFshBW1JreFHh3tJPYEibvtTFBNiCtpp5tkodoY08Y3Zm/Js/qf4ajjwdRsZ9c
	vPAadRtZ8JYOUOHjkDMFBEEz2+3jUUazDbsNa9fBvlo1tf848I4HcCmIW4F+LSLY3i4qjAdc61S
	oW7+OiYoRcRZ8AhNiKs3aOfpkpdVLnRlit2RZXQieHces0rbaurtoLPdmogDc7EuzPgwg40yfEy
	+16Wka1BrRDdcYlV/MndAJp//6inCd8jg2rGyWgChoNVPTehIt2oDYENonHOh01pSSI8cOHbAI3
	5TbOhSpxXKpqxoB1N3v1BG8Ho5Jk5Sf9BQ==
X-Received: by 2002:a05:6000:26ce:b0:48e:412:3829 with SMTP id ffacd0b85a97d-48e5d2e6cddmr11477145f8f.15.1793275344652;
        Thu, 29 Oct 2026 05:02:24 -0700 (PDT)
X-Received: from debian ([102.88.113.135])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e3ebd49afsm34522764f8f.35.2026.10.29.05.02.17
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 29 Oct 2026 05:02:24 -0700 (PDT)
X-Cc: Ogundipe Sola Taiwo <ogundipesolataiwo12@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Christian Couder <christian.couder@gmail.com>,
	Siddharth Asthana <siddharthasthana31@gmail.com>,
	Usman Akinyemi <usmanakinyemi202@gmail.com>
X-Mailer: git-send-email 2.56.0.116.g6de20f6092.dirty
X-In-Reply-To: <20261023154851.7876-1-ogundipesolataiwo12@gmail.com>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list