summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2021-04-18 12:21:53 -0400
committerTavian Barnes <tavianator@tavianator.com>2021-04-18 12:21:53 -0400
commit79438c36f541ae05a2b8055bc4b2337fca5753eb (patch)
treec3e022ee95492f68b3e70c1bc92feba6a359b7ce
parent9870b77f9000c55bbe507bbb11d6d20fac2e8da0 (diff)
downloadbfs-79438c36f541ae05a2b8055bc4b2337fca5753eb.tar.xz
tests: Add a test for deleting large directories
This serves as a test for https://github.com/tavianator/bfs/issues/67
-rwxr-xr-xtests.sh12
-rw-r--r--tests/test_delete_many.out1
2 files changed, 13 insertions, 0 deletions
diff --git a/tests.sh b/tests.sh
index 81ed14e..0045ce5 100755
--- a/tests.sh
+++ b/tests.sh
@@ -331,6 +331,7 @@ bsd_tests=(
test_asince
test_delete
+ test_delete_many
test_depth_maxdepth_1
test_depth_maxdepth_2
@@ -473,6 +474,7 @@ gnu_tests=(
test_daystart_twice
test_delete
+ test_delete_many
test_L_delete
test_depth_mindepth_1
@@ -1865,6 +1867,16 @@ function test_delete() {
bfs_diff scratch
}
+function test_delete_many() {
+ # Test for https://github.com/tavianator/bfs/issues/67
+
+ rm -rf scratch/*
+ touchp scratch/foo/{1..256}
+
+ invoke_bfs scratch/foo -delete
+ bfs_diff scratch
+}
+
function test_L_delete() {
rm -rf scratch/*
mkdir scratch/foo
diff --git a/tests/test_delete_many.out b/tests/test_delete_many.out
new file mode 100644
index 0000000..fb188b9
--- /dev/null
+++ b/tests/test_delete_many.out
@@ -0,0 +1 @@
+scratch