commit: 2fdfcbb0cef9aee5d2372dc243945d85c8cec0d5
parent be199cb160307c2cf1c5ef591ebcd3fd2247ba74
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 18 Sep 2024 05:10:04 +0200
test-cmd/mkdir.sh: don't rely on rm output
Technically could add a "$target_rm" but early exit is also fine.
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/test-cmd/mkdir.sh b/test-cmd/mkdir.sh
@@ -18,7 +18,7 @@ t_mkdir() {
t_err=0
test ! -e "$@" || return 1
- "${target}" "$@" || t_err=1
+ "${target}" "$@" || return 1
test -d "$@" || t_err=1
rm -r "$@" || t_err=1
@@ -27,7 +27,6 @@ t_mkdir() {
t_cmd foo '' t_mkdir foo
t_cmd --exit=1 foo "mkdir: Failed making directory 'enoent/file': No such file or directory
-rm: Failed getting status for 'enoent/file': No such file or directory
" t_mkdir enoent/file
t_mkdir_parents() {
@@ -50,7 +49,7 @@ t_mkdir_v() {
for dir; do
test ! -e "$dir" || return 1
done
- "${target}" -v "$@" || t_err=1
+ "${target}" -v "$@" || return 1
for dir; do
test -d "$dir" || t_err=1
done
@@ -63,7 +62,6 @@ mkdir: Made directory: verbose2
" t_mkdir_v verbose1 verbose2
t_cmd --exit=1 verbose_no_parents "mkdir: Failed making directory 'verbose_foo/verbose_bar': No such file or directory
-rm: Failed getting status for 'verbose_foo/verbose_bar': No such file or directory
" t_mkdir_v verbose_foo/verbose_bar
t_mkdir_mode() {