summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2015-11-27 12:25:06 -0500
committerTavian Barnes <tavianator@tavianator.com>2015-11-27 12:25:06 -0500
commitf2023abb0ad5002078d5244e8dc17ac1cead40e4 (patch)
tree7833a4c390c3e17cb0e6804233dee99091a21fd9 /tests.sh
parent154dc9258f62af852f91cd5eb1202405f71a50a5 (diff)
downloadbfs-f2023abb0ad5002078d5244e8dc17ac1cead40e4.tar.xz
Implement -path.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests.sh b/tests.sh
index 65e439b..060448b 100755
--- a/tests.sh
+++ b/tests.sh
@@ -13,6 +13,9 @@ function basic_structure() {
touchp "$1/e/f"
mkdir -p "$1/g/h"
mkdir -p "$1/i"
+ touchp "$1/j/foo"
+ touchp "$1/k/foo/bar"
+ touchp "$1/l/foo/bar/baz"
}
# Checks for any (order-independent) differences between bfs and find
@@ -67,7 +70,17 @@ function test_0009() {
find_diff "$1" -maxdepth 2 -depth
}
-for i in {1..9}; do
+function test_0010() {
+ basic_structure "$1"
+ find_diff "$1" -name '*f*'
+}
+
+function test_0011() {
+ basic_structure "$1"
+ find_diff "$1" -path "$1/*f*"
+}
+
+for i in {1..11}; do
dir="$(mktemp -d "${TMPDIR:-/tmp}"/bfs.XXXXXXXXXX)"
test="test_$(printf '%04d' $i)"
"$test" "$dir"