diff options
| author | Pushkar Singh <pushkarkumarsingh1970@gmail.com> | 2026-01-04 19:47:59 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-01-05 10:58:58 +0900 |
| commit | 404b6772297c77f48de298adf11ab94f080eba72 (patch) | |
| tree | 4a5e7e90788d1992488279964d4ee7e469bb173f | |
| parent | 68cb7f9e92a5d8e9824f5b52ac3d0a9d8f653dbe (diff) | |
| download | git-404b6772297c77f48de298adf11ab94f080eba72.tar.xz | |
t1300: use test helpers instead of `test` command
Replace `test -f` and `test -h` checks with `test_path_is_file` and
`test_path_is_symlink`. Using the test framework helpers provides
clearer diagnostics and keeps tests consistent across the suite.
Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rwxr-xr-x | t/t1300-config.sh | 8 | ||||
| -rwxr-xr-x | t/t2021-checkout-overwrite.sh | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 358d636379..9850fcd5b5 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -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 diff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh index a5c03d5d4a..38c41ae373 100755 --- a/t/t2021-checkout-overwrite.sh +++ b/t/t2021-checkout-overwrite.sh @@ -27,7 +27,7 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' ' git rm --cached a/b && git commit -m "un-track the file" && test_must_fail git checkout start && - test -f a/b + test_path_is_file a/b ' test_expect_success 'create a commit where dir a/b changed to symlink' ' @@ -49,7 +49,7 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' ' test_expect_success SYMLINKS 'the symlink remained' ' - test -h a/b + test_path_is_symlink a/b ' test_expect_success 'cleanup after previous symlink tests' ' |
