git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: shejialuo <shejialuo@gmail.com>
To: git@vger.kernel.org
Cc: shejialuo <shejialuo@gmail.com>
Subject: [PATCH 1/1] [GSoC][PATCH] t3070: refactor test -e command
Date: Thu, 29 Feb 2024 23:04:42 +0800	[thread overview]
Message-ID: <20240229150442.490649-2-shejialuo@gmail.com> (raw)
In-Reply-To: <20240229150442.490649-1-shejialuo@gmail.com>

The "test_path_exists" function was proposed at 7e9055b. It provides
parameter number check and more robust error messages.

This patch converts all "test -e" into "test_path_exists" to improve
test debug when failure.

Signed-off-by: shejialuo <shejialuo@gmail.com>
---
 t/t3070-wildmatch.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
index 4dd42df38c..d18ddc1a52 100755
--- a/t/t3070-wildmatch.sh
+++ b/t/t3070-wildmatch.sh
@@ -107,7 +107,7 @@ match_with_ls_files() {
 
 	if test "$match_expect" = 'E'
 	then
-		if test -e .git/created_test_file
+		if test_path_exists .git/created_test_file
 		then
 			test_expect_success EXPENSIVE_ON_WINDOWS "$match_function (via ls-files): match dies on '$pattern' '$text'" "
 				printf '%s' '$text' >expect &&
@@ -118,7 +118,7 @@ match_with_ls_files() {
 		fi
 	elif test "$match_expect" = 1
 	then
-		if test -e .git/created_test_file
+		if test_path_exists .git/created_test_file
 		then
 			test_expect_success EXPENSIVE_ON_WINDOWS "$match_function (via ls-files): match '$pattern' '$text'" "
 				printf '%s' '$text' >expect &&
@@ -130,7 +130,7 @@ match_with_ls_files() {
 		fi
 	elif test "$match_expect" = 0
 	then
-		if test -e .git/created_test_file
+		if test_path_exists .git/created_test_file
 		then
 			test_expect_success EXPENSIVE_ON_WINDOWS "$match_function (via ls-files): no match '$pattern' '$text'" "
 				>expect &&
@@ -175,7 +175,7 @@ match() {
 	fi
 
 	test_expect_success EXPENSIVE_ON_WINDOWS 'cleanup after previous file test' '
-		if test -e .git/created_test_file
+		if test_path_exists .git/created_test_file
 		then
 			git reset &&
 			git clean -df
@@ -198,7 +198,7 @@ match() {
 			fi &&
 			git add -A &&
 			printf "%s" "$file" >.git/created_test_file
-		elif test -e .git/created_test_file
+		elif test_path_exists .git/created_test_file
 		then
 			rm .git/created_test_file
 		fi
-- 
2.44.0



  reply	other threads:[~2024-02-29 15:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 15:04 [GSoC][PATCH 0/1] microproject: Use test_path_is_* functions in test scripts shejialuo
2024-02-29 15:04 ` shejialuo [this message]
2024-02-29 17:58   ` [PATCH 1/1] [GSoC][PATCH] t3070: refactor test -e command Eric Sunshine
2024-02-29 19:06     ` Junio C Hamano
2024-03-04  9:16       ` [PATCH] SoC 2024: clarify `test_path_is_*` conversion microproject Patrick Steinhardt
2024-03-04 13:42         ` Christian Couder
2024-03-04 17:02         ` Junio C Hamano
2024-03-04  9:17       ` [PATCH 1/1] [GSoC][PATCH] t3070: refactor test -e command Patrick Steinhardt
2024-03-01  2:50     ` shejialuo
2024-03-01  3:46 ` [PATCH V2 0/1] [GSoC][PATCH] t9117: prefer test_path_* helper functions shejialuo
2024-03-01  3:46   ` [PATCH 1/1] " shejialuo
2024-03-01  4:44     ` Eric Sunshine
2024-03-01 11:29       ` shejialuo
2024-03-01  5:09     ` Junio C Hamano
2024-03-01 11:36       ` shejialuo
2024-03-01 13:03   ` [PATCH v3 0/1] " shejialuo
2024-03-01 13:03     ` [PATCH v3 1/1] [PATCH] " shejialuo
2024-03-04  9:24       ` Patrick Steinhardt
2024-03-04  9:54     ` [PATCH v4 0/1] Change commit message shejialuo
2024-03-04  9:54       ` [PATCH v4 1/1] [PATCH] t9117: prefer test_path_* helper functions shejialuo
2024-03-04  9:59         ` Patrick Steinhardt
2024-03-04 11:45           ` shejialuo
2024-03-04 17:50           ` Junio C Hamano
2024-03-04 17:22         ` Junio C Hamano
2024-03-05 11:42           ` shejialuo
2024-03-04 17:19       ` [PATCH v4 0/1] Change commit message Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240229150442.490649-2-shejialuo@gmail.com \
    --to=shejialuo@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).