summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-07-20 23:14:48 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-07-20 23:26:02 -0400
commit03adbcf0aa8914fd5556b7913901c98a6940fae4 (patch)
tree03b085bae5ae82d5802990f1c63232df5c1449b6 /tests.sh
parent3a94d05833019023636bc8ac55a686f4fa8cf3d8 (diff)
downloadbfs-03adbcf0aa8914fd5556b7913901c98a6940fae4.tar.xz
Implement -rm as an alias for -delete
From NetBSD.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh23
1 files changed, 19 insertions, 4 deletions
diff --git a/tests.sh b/tests.sh
index a2b1681..a701e3d 100755
--- a/tests.sh
+++ b/tests.sh
@@ -223,7 +223,8 @@ bsd_tests=(
test_flag_double_dash
test_ok_stdin
test_okdir_stdin
- test_delete_root
+ test_delete
+ test_rm
test_execdir_slash
test_execdir_slash_pwd
test_execdir_slashes
@@ -305,7 +306,7 @@ gnu_tests=(
test_perm_644_slash
test_perm_symbolic_slash
test_perm_leading_plus_symbolic_slash
- test_delete_root
+ test_delete
test_execdir_slash
test_execdir_slash_pwd
test_execdir_slashes
@@ -899,9 +900,23 @@ function test_okdir_stdin() {
yes | bfs_diff basic -okdir bash -c "printf '%s? ' {} && head -n1" \; 2>/dev/null
}
-function test_delete_root() {
+function test_delete() {
+ rm -rf scratch/*
+ touchp scratch/foo/bar/baz
+
# Don't try to delete '.'
- (cd scratch && $BFS . -delete)
+ (cd scratch && $BFS -delete)
+
+ bfs_diff scratch
+}
+
+function test_rm() {
+ rm -rf scratch/*
+ touchp scratch/foo/bar/baz
+
+ (cd scratch && $BFS -rm)
+
+ bfs_diff scratch
}
function test_execdir_slash() {