t9117: prefer test_path_* helper functions

test -(e|d) does not provide a nice error message when we hit test failures, so use test_path_exists, test_path_is_dir instead. Signed-off-by: shejialuo <shejialuo@gmail.com> Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

shejialuo committed Mar 4, 2024 at 17:54 UTC 0332e813d6b4a9413684830f3ac02715633dc544
1 file changed +8 -8
t/t9117-git-svn-init-clone.sh
+8 -8
@@ -17,32 +17,32 @@ test_expect_success 'setup svnrepo' '
17 test_expect_success 'basic clone' '
18 test ! -d trunk &&
19 git svn clone "$svnrepo"/project/trunk &&
20 - test -d trunk/.git/svn &&
21 - test -e trunk/foo &&
20 + test_path_is_dir trunk/.git/svn &&
21 + test_path_exists trunk/foo &&
22 rm -rf trunk
23 '
24
25 test_expect_success 'clone to target directory' '
26 test ! -d target &&
27 git svn clone "$svnrepo"/project/trunk target &&
28 - test -d target/.git/svn &&
29 - test -e target/foo &&
28 + test_path_is_dir target/.git/svn &&
29 + test_path_exists target/foo &&
30 rm -rf target
31 '
32
33 test_expect_success 'clone with --stdlayout' '
34 test ! -d project &&
35 git svn clone -s "$svnrepo"/project &&
36 - test -d project/.git/svn &&
37 - test -e project/foo &&
36 + test_path_is_dir project/.git/svn &&
37 + test_path_exists project/foo &&
38 rm -rf project
39 '
40
41 test_expect_success 'clone to target directory with --stdlayout' '
42 test ! -d target &&
43 git svn clone -s "$svnrepo"/project target &&
44 - test -d target/.git/svn &&
45 - test -e target/foo &&
44 + test_path_is_dir target/.git/svn &&
45 + test_path_exists target/foo &&
46 rm -rf target
47 '
48