Skip to content

Commit 404b677

Browse files
pushkarscriptsgitster
authored andcommitted
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>
1 parent 68cb7f9 commit 404b677

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

t/t1300-config.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,12 +1232,12 @@ test_expect_success SYMLINKS 'symlinked configuration' '
12321232
test_when_finished "rm myconfig" &&
12331233
ln -s notyet myconfig &&
12341234
git config --file=myconfig test.frotz nitfol &&
1235-
test -h myconfig &&
1236-
test -f notyet &&
1235+
test_path_is_symlink myconfig &&
1236+
test_path_is_file notyet &&
12371237
test "z$(git config --file=notyet test.frotz)" = znitfol &&
12381238
git config --file=myconfig test.xyzzy rezrov &&
1239-
test -h myconfig &&
1240-
test -f notyet &&
1239+
test_path_is_symlink myconfig &&
1240+
test_path_is_file notyet &&
12411241
cat >expect <<-\EOF &&
12421242
nitfol
12431243
rezrov

t/t2021-checkout-overwrite.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '
2727
git rm --cached a/b &&
2828
git commit -m "un-track the file" &&
2929
test_must_fail git checkout start &&
30-
test -f a/b
30+
test_path_is_file a/b
3131
'
3232

3333
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' '
4949

5050
test_expect_success SYMLINKS 'the symlink remained' '
5151
52-
test -h a/b
52+
test_path_is_symlink a/b
5353
'
5454

5555
test_expect_success 'cleanup after previous symlink tests' '

0 commit comments

Comments
 (0)