From 0f09fc54fdf6d5cd453ea0e9fb363756baf87dae Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 9 Feb 2016 10:34:36 -0500 Subject: Implement -L/-follow. --- tests.sh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index 493bfab..8c8c347 100755 --- a/tests.sh +++ b/tests.sh @@ -33,10 +33,10 @@ function links_structure() { touchp "$1/a" ln -s a "$1/b" ln "$1/a" "$1/c" - mkdir -p "$1/d/e" - ln -s ../../d "$1/d/e/f" - touchp "$1/d/e/g" - ln -s q "$1/d/e/h" + mkdir -p "$1/d/e/f" + ln -s ../../d "$1/d/e/g" + ln -s d/e "$1/h" + ln -s q "$1/d/e/i" } # Checks for any (order-independent) differences between bfs and find @@ -171,10 +171,25 @@ function test_0023() { function test_0024() { links_structure "$1" - find_diff -H "$1/d/e/h" + find_diff -H "$1/d/e/i" } -for i in {1..24}; do +function test_0025() { + links_structure "$1" + find_diff -L "$1" 2>/dev/null +} + +function test_0026() { + links_structure "$1" + find_diff "$1" -follow 2>/dev/null +} + +function test_0027() { + links_structure "$1" + find_diff -L "$1" -depth 2>/dev/null +} + +for i in {1..27}; do dir="$(mktemp -d "${TMPDIR:-/tmp}"/bfs.XXXXXXXXXX)" test="test_$(printf '%04d' $i)" "$test" "$dir" -- cgit v1.2.3