Git development
 help / color / mirror / Atom feed
* [PATCH] t0450: use test_path_is_file and test_path_is_missing
@ 2026-10-06 10:14 Muhammed Dilshad A
  2026-10-06 12:23 ` Patrick Steinhardt
  0 siblings, 1 reply; 2+ messages in thread
From: Muhammed Dilshad A @ 2026-10-06 10:14 UTC (permalink / raw)
  To: git; +Cc: Muhammed Dilshad A

Replace raw 'test -f' and '! test -f' assertions with the test helper
functions 'test_path_is_file' and 'test_path_is_missing' to provide
diagnostic output when an assertion fails.

Signed-off-by: Muhammed Dilshad A <dilsheddilu123@gmail.com>
---
 t/t0450-txt-doc-vs-help.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t0450-txt-doc-vs-help.sh b/t/t0450-txt-doc-vs-help.sh
index 55c0fb3cb7..a2da2b0192 100755
--- a/t/t0450-txt-doc-vs-help.sh
+++ b/t/t0450-txt-doc-vs-help.sh
@@ -116,13 +116,13 @@ do
 	if grep -q "^$builtin$" "$TEST_DIRECTORY"/t0450/adoc-missing
 	then
 		test_expect_success "$builtin appropriately marked as not having .adoc" '
-			! test -f "$adoc"
+			test_path_is_missing "$adoc"
 		'
 	else
 		test_set_prereq "$preq"
 
 		test_expect_success "$builtin appropriately marked as having .adoc" '
-			test -f "$adoc"
+			test_path_is_file "$adoc"
 		'
 	fi
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] t0450: use test_path_is_file and test_path_is_missing
  2026-10-06 10:14 [PATCH] t0450: use test_path_is_file and test_path_is_missing Muhammed Dilshad A
@ 2026-10-06 12:23 ` Patrick Steinhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Steinhardt @ 2026-10-06 12:23 UTC (permalink / raw)
  To: Muhammed Dilshad A; +Cc: git

On Tue, Oct 06, 2026 at 03:44:58PM +0530, Muhammed Dilshad A wrote:
> Replace raw 'test -f' and '! test -f' assertions with the test helper
> functions 'test_path_is_file' and 'test_path_is_missing' to provide
> diagnostic output when an assertion fails.
> 
> Signed-off-by: Muhammed Dilshad A <dilsheddilu123@gmail.com>

Good commit message, pinpointing exactly why we even bother to do this
change.

> diff --git a/t/t0450-txt-doc-vs-help.sh b/t/t0450-txt-doc-vs-help.sh
> index 55c0fb3cb7..a2da2b0192 100755
> --- a/t/t0450-txt-doc-vs-help.sh
> +++ b/t/t0450-txt-doc-vs-help.sh
> @@ -116,13 +116,13 @@ do
>  	if grep -q "^$builtin$" "$TEST_DIRECTORY"/t0450/adoc-missing
>  	then
>  		test_expect_success "$builtin appropriately marked as not having .adoc" '
> -			! test -f "$adoc"
> +			test_path_is_missing "$adoc"
>  		'
>  	else
>  		test_set_prereq "$preq"
>  
>  		test_expect_success "$builtin appropriately marked as having .adoc" '
> -			test -f "$adoc"
> +			test_path_is_file "$adoc"
>  		'
>  	fi

And the change looks obviously good to me, as well. Thanks!

Patrick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-06 12:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-06 10:14 [PATCH] t0450: use test_path_is_file and test_path_is_missing Muhammed Dilshad A
2026-10-06 12:23 ` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox