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>
This commit is contained in:
shejialuo 2024-03-04 17:54:36 +08:00 committed by Junio C Hamano
parent b387623c12
commit 0332e813d6

View file

@ -17,32 +17,32 @@ test_expect_success 'setup svnrepo' '
test_expect_success 'basic clone' '
test ! -d trunk &&
git svn clone "$svnrepo"/project/trunk &&
test -d trunk/.git/svn &&
test -e trunk/foo &&
test_path_is_dir trunk/.git/svn &&
test_path_exists trunk/foo &&
rm -rf trunk
'
test_expect_success 'clone to target directory' '
test ! -d target &&
git svn clone "$svnrepo"/project/trunk target &&
test -d target/.git/svn &&
test -e target/foo &&
test_path_is_dir target/.git/svn &&
test_path_exists target/foo &&
rm -rf target
'
test_expect_success 'clone with --stdlayout' '
test ! -d project &&
git svn clone -s "$svnrepo"/project &&
test -d project/.git/svn &&
test -e project/foo &&
test_path_is_dir project/.git/svn &&
test_path_exists project/foo &&
rm -rf project
'
test_expect_success 'clone to target directory with --stdlayout' '
test ! -d target &&
git svn clone -s "$svnrepo"/project target &&
test -d target/.git/svn &&
test -e target/foo &&
test_path_is_dir target/.git/svn &&
test_path_exists target/foo &&
rm -rf target
'