diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2016-02-09 10:34:36 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2016-02-09 10:40:49 -0500 |
commit | 0f09fc54fdf6d5cd453ea0e9fb363756baf87dae (patch) | |
tree | 6b69675ba45394c40929ca92c0eb13d1dd53cd1c /tests.sh | |
parent | b46da967104df09edcad706e5e8ef31326a113dd (diff) | |
download | bfs-0f09fc54fdf6d5cd453ea0e9fb363756baf87dae.tar.xz |
Implement -L/-follow.
Diffstat (limited to 'tests.sh')
-rwxr-xr-x | tests.sh | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -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" |