Skip to contentSkip to conversation

t0450: use test_path_is_file and test_path_is_missing

PATCH In review Muhammed Dilshad A 2 participants 2 messages Oct 6

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t0450: use test_path_is_file and test_path_is_missing

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.

---
 t/t0450-txt-doc-vs-help.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
t/t0450-txt-doc-vs-help.sh +2 -2
index 55c0fb3cb7..a2da2b0192 100755
@@ -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
 
Signature · 1 line
2.55.0
#1 lore raw
Quoted 5 lines · 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.

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

Quoted 9 lines
t/t0450-txt-doc-vs-help.sh +0 -1
index 55c0fb3cb7..a2da2b0192 100755
@@ -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"

t/t0450-txt-doc-vs-help.sh do · line 127

Quoted 10 lines
t/t0450-txt-doc-vs-help.sh +2 -1
+			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