From: Aryan Pathania <contact@aynp•dev>
To: git@vger•kernel.org
Cc: Aryan Pathania <contact@aynp•dev>
Subject: [GSoC PATCH] t9400: prefer test_path_* helper functions
Date: Sat, 8 Mar 2025 18:03:58 +0900 [thread overview]
Message-ID: <20250308090358.25429-1-contact@aynp.dev> (raw)
use `test_path_*` instead of `test -[efd]` to avoid false complaints and
output when running the script with `-v` or `-x`
Signed-off-by: Aryan Pathania <contact@aynp•dev>
---
t/t9400-git-cvsserver-server.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index e499c7f955..6c7cb1964c 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -254,7 +254,7 @@ test_expect_success 'gitcvs.enabled = false' \
true
fi &&
grep "GITCVS emulation disabled" cvs.log &&
- test ! -d cvswork2'
+ test_path_is_missing cvswork2'
rm -fr cvswork2
test_expect_success 'gitcvs.ext.enabled = true' '
@@ -276,7 +276,7 @@ test_expect_success 'gitcvs.ext.enabled = false' '
true
fi &&
grep "GITCVS emulation disabled" cvs.log &&
- test ! -d cvswork2
+ test_path_is_missing cvswork2
'
rm -fr cvswork2
@@ -285,7 +285,7 @@ test_expect_success 'gitcvs.dbname' '
GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
test_cmp cvswork cvswork2 &&
- test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
+ test_path_is_file_not_symlink "$SERVERDIR/gitcvs.ext.main.sqlite" &&
cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"
'
@@ -296,8 +296,8 @@ test_expect_success 'gitcvs.ext.dbname' '
GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
test_cmp cvswork cvswork2 &&
- test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
- test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
+ test_path_is_file_not_symlink "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
+ test_path_is_missing "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"
'
@@ -346,7 +346,7 @@ test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" '
git push gitcvs.git >/dev/null &&
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
- test ! -d test
+ test_path_is_missing test
'
cd "$WORKDIR"
@@ -379,7 +379,7 @@ test_expect_success 'cvs update (delete file)' '
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
test -z "$(grep testfile1 CVS/Entries)" &&
- test ! -f testfile1
+ test_path_is_missing testfile1
'
cd "$WORKDIR"
--
2.39.5 (Apple Git-154)
next reply other threads:[~2025-03-08 9:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-08 9:03 Aryan Pathania [this message]
2025-03-10 6:50 ` [GSoC PATCH] t9400: prefer test_path_* helper functions Patrick Steinhardt
2025-03-12 17:34 ` Aryan Pathania
2025-03-12 18:13 ` Junio C Hamano
2025-03-14 12:00 ` Aryan Pathania
2025-03-14 17:07 ` Junio C Hamano
2025-03-18 13:10 ` [GSoC PATCH v2] Use `test_path_*` helper functions instead of `test -[efd]` Aryan Pathania
2025-03-18 22:06 ` Eric Sunshine
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250308090358.25429-1-contact@aynp.dev \
--to=contact@aynp$(echo .)dev \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox