git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] t0200: replace 'test -d' with 'test_path_is_dir' and 'test -f' with 'test_path_is_file'

From
DFDerick W. de M. Frias <derick.william.moraes@gmail.com>
Date
Jun 18, 2025, 18:31 UTC
Message-ID
<20250618183754.108821-1-derick.william.moraes@gmail.com>
In-Reply-To
<aD6TJLuuaZmiFUvZ@pks.im>

Thanks for your feedback Patrick. I'm resending the patch with your suggestions.

'test_path_is_file' and 'test_path_is_dir' are modern debbuging-friendly path checking methods in Git's development that output useful messages when the test fails, unlike 'test -f' and 'test -d' that don't provide feedback.

Replace 'test -d' and 'test -f' methods with 'test_path_is_dir' and 'test_path_is_file'.

Signed-off-by: Derick W. de M. Frias <derick.william.moraes@gmail.com>
---
 t/t0200-gettext-basic.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t0200-gettext-basic.sh b/t/t0200-gettext-basic.sh
index 8853d8afb9..89d0899a5b 100755
--- a/t/t0200-gettext-basic.sh
+++ b/t/t0200-gettext-basic.sh
@@ -31,12 +31,12 @@ test_expect_success 'xgettext sanity: Comment extraction with --add-comments sto
 '
 
 test_expect_success GETTEXT 'sanity: $TEXTDOMAINDIR exists without NO_GETTEXT=YesPlease' '
-    test -d "$TEXTDOMAINDIR" &&
+    test_path_is_dir "$TEXTDOMAINDIR" &&
     test "$TEXTDOMAINDIR" = "$GIT_TEXTDOMAINDIR"
 '
 
 test_expect_success GETTEXT 'sanity: Icelandic locale was compiled' '
-    test -f "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo"
+    test_path_is_file "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo"
 '
 
 # TODO: When we have more locales, generalize this to test them
-- 
2.50.0.rc0.62.g658f0ae201.dirty
Previous: Patrick Steinhardt
Message 3 of 3 in “t0200: replace 'test -d' with 'test_path_is_dir' and 'test -f' with 'test_path_is_file'”
  1. t0200: replace 'test -d' with 'test_path_is_dir' and 'test -f' with 'test_path_is_file'Derick W. de M. Frias, Jun 3, 2025
  2. Patrick SteinhardtJun 3, 2025
  3. t0200: replace 'test -d' with 'test_path_is_dir' and 'test -f' with 'test_path_is_file'Derick W. de M. Frias, Jun 18, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.