summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-02-04 23:12:08 -0500
committerTavian Barnes <tavianator@tavianator.com>2016-02-04 23:12:08 -0500
commit0f91c5861cacaeb17729b7727d07260273345393 (patch)
tree8348044cc4697e2576a401fe81c2d5bca7dbc0eb /tests.sh
parentc9905877cb06f71c4523e4f4875bf549b6b54060 (diff)
downloadbfs-0f91c5861cacaeb17729b7727d07260273345393.tar.xz
Implement -P and -H.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests.sh b/tests.sh
index ffb110d..0a2f60a 100755
--- a/tests.sh
+++ b/tests.sh
@@ -35,6 +35,7 @@ function links_structure() {
ln "$1/a" "$1/c"
mkdir -p "$1/d/e"
ln -s ../../d "$1/d/e/f"
+ touchp "$1/d/e/g"
}
# Checks for any (order-independent) differences between bfs and find
@@ -150,7 +151,24 @@ function test_0020() {
find_diff "$1" -links +1
}
-for i in {1..20}; do
+function test_0021() {
+ links_structure "$1"
+ find_diff -P "$1/d/e/f" && \
+ find_diff -P "$1/d/e/f/"
+}
+
+function test_0022() {
+ links_structure "$1"
+ find_diff -H "$1/d/e/f" && \
+ find_diff -H "$1/d/e/f/"
+}
+
+function test_0023() {
+ links_structure "$1"
+ find_diff -H "$1" -newer "$1/d/e/f"
+}
+
+for i in {1..23}; do
dir="$(mktemp -d "${TMPDIR:-/tmp}"/bfs.XXXXXXXXXX)"
test="test_$(printf '%04d' $i)"
"$test" "$dir"