summaryrefslogtreecommitdiffstats
path: root/tests/common
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-24 11:07:33 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-24 11:08:10 -0400
commitd597be5bc1ee0e76117037b7d9a52c52fd4531ad (patch)
treea8384fcb4cabde1da989b8c3e3b114b8114dfcc0 /tests/common
parent30e309de41aaca259c4d0a200daa42ba74cbc5a5 (diff)
downloadbfs-d597be5bc1ee0e76117037b7d9a52c52fd4531ad.tar.xz
eval: Plug memory leak if bfs_opendir() fails
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/empty.out8
-rw-r--r--tests/common/empty.sh1
-rw-r--r--tests/common/empty_error.out3
-rw-r--r--tests/common/empty_error.sh7
-rw-r--r--tests/common/empty_special.out20
-rw-r--r--tests/common/empty_special.sh1
6 files changed, 40 insertions, 0 deletions
diff --git a/tests/common/empty.out b/tests/common/empty.out
new file mode 100644
index 0000000..a0f4b76
--- /dev/null
+++ b/tests/common/empty.out
@@ -0,0 +1,8 @@
+basic/a
+basic/b
+basic/c/d
+basic/e/f
+basic/g/h
+basic/i
+basic/j/foo
+basic/k/foo/bar
diff --git a/tests/common/empty.sh b/tests/common/empty.sh
new file mode 100644
index 0000000..95ee988
--- /dev/null
+++ b/tests/common/empty.sh
@@ -0,0 +1 @@
+bfs_diff basic -empty
diff --git a/tests/common/empty_error.out b/tests/common/empty_error.out
new file mode 100644
index 0000000..da45e23
--- /dev/null
+++ b/tests/common/empty_error.out
@@ -0,0 +1,3 @@
+./bar
+./baz
+./qux
diff --git a/tests/common/empty_error.sh b/tests/common/empty_error.sh
new file mode 100644
index 0000000..7c8049c
--- /dev/null
+++ b/tests/common/empty_error.sh
@@ -0,0 +1,7 @@
+cd "$TEST"
+
+"$XTOUCH" -p foo/ bar/ baz qux
+chmod -r foo baz
+defer chmod +r foo baz
+
+! bfs_diff . -empty
diff --git a/tests/common/empty_special.out b/tests/common/empty_special.out
new file mode 100644
index 0000000..fa35478
--- /dev/null
+++ b/tests/common/empty_special.out
@@ -0,0 +1,20 @@
+rainbow//
+rainbow/exec.sh
+rainbow/file.dat
+rainbow/file.txt
+rainbow/lower.gz
+rainbow/lower.tar
+rainbow/lower.tar.gz
+rainbow/lu.tar.GZ
+rainbow/mh1
+rainbow/mh2
+rainbow/ow
+rainbow/sgid
+rainbow/sticky
+rainbow/sticky_ow
+rainbow/sugid
+rainbow/suid
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/common/empty_special.sh b/tests/common/empty_special.sh
new file mode 100644
index 0000000..31e9d2e
--- /dev/null
+++ b/tests/common/empty_special.sh
@@ -0,0 +1 @@
+bfs_diff rainbow -empty