logo

utils-std

Collection of commonly available Unix tools
commit: f68d1b2540aceaaf51f35b16e61f4883992aefd2
parent 36538f23a98779c9abb2c807f26796be3ce67f5b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 28 Mar 2024 18:30:12 +0100

test-cmd/rm.t: Make sure all files got removed

Diffstat:

Mtest-cmd/rm.t8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/test-cmd/rm.t b/test-cmd/rm.t @@ -37,6 +37,8 @@ POSIX rm(1p) step 2a: [1] $ test -d no_rR.d $ test ! -e no_rR.f + $ rm -r no_rR.d + $ test ! -e no_rR.d POSIX rm(1p) step 2b, empty directory, no -i $ mkdir 2b-empty-noi @@ -73,6 +75,7 @@ POSIX rm(1p) step 2c, don't follow symlinks $ test ! -e 2c-symlinks $ test -d 2c-origin $ test -f 2c-origin/file + $ rm -r 2c-origin POSIX rm(1p) step 3, no write Extra check from rm(1), unrelated to the EPERM that unlink gets on a non-writable directory @@ -135,6 +138,7 @@ Don't follow symlinks $ rm foo $ test -e bar $ test ! -e foo + $ rm bar Correct path when multiple files are given $ touch path_v_foo path_v_bar @@ -160,3 +164,7 @@ Correct path when multiple files are given $ test ! -e dir_v_foo $ test ! -e dir_v_bar $ test ! -e dir_v_dir + +No files should be left + $ find + .