Skip to contentSkip to conversation

t1300: use test helpers instead of shell primitives

PATCH Superseded [email protected] 1 participant 1 message Jan 2

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 t1300: use test helpers instead of shell primitives

From: Pushkar Singh <[email protected]>

Replace plain "test -f" (regular file checks) with "test_path_is_file" and "test -h" (symbolic link checks) with "test_path_is_symlink". The test framework helpers provide clearer diagnostics and better consistency across the test suite.

---
v2: expand commit message to clarify that
- test -f checks regular files
- test -h checks symbolic links

 t/t1300-config.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
t/t1300-config.sh +4 -4
index 358d636379..9850fcd5b5 100755
@@ -1232,12 +1232,12 @@ test_expect_success SYMLINKS 'symlinked configuration' '
 	test_when_finished "rm myconfig" &&
 	ln -s notyet myconfig &&
 	git config --file=myconfig test.frotz nitfol &&
-	test -h myconfig &&
-	test -f notyet &&
+	test_path_is_symlink myconfig &&
+	test_path_is_file notyet &&
 	test "z$(git config --file=notyet test.frotz)" = znitfol &&
 	git config --file=myconfig test.xyzzy rezrov &&
-	test -h myconfig &&
-	test -f notyet &&
+	test_path_is_symlink myconfig &&
+	test_path_is_file notyet &&
 	cat >expect <<-\EOF &&
 	nitfol
 	rezrov
Signature · 1 line
2.43.0