]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: shred: check the removal of files in a subdirectory
authorCollin Funk <collin.funk1@gmail.com>
Sat, 30 May 2026 09:09:10 +0000 (02:09 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Sat, 30 May 2026 17:25:40 +0000 (10:25 -0700)
* tests/shred/shred-remove.sh: Add a test case.

tests/shred/shred-remove.sh

index 6df27856175f31b09a203c2e460ad162c1f5d0fa..2f393c57f41d68c81c8e03998744eda1227c2f53 100755 (executable)
@@ -63,6 +63,12 @@ shred: test: removed
 EOF
 compare exp out || fail=1
 
+# Test the behavior when the file is in a directory.
+mkdir dir || framework_failure_
+echo > dir/$file || framework_failure_
+shred -u dir/$file || fail=1
+test -e dir/$file && fail=1
+
 # Ensure with stdout, file is deallocated but not removed
 echo > $file || framework_failure_
 shred -u - > $file || fail=1