From 1358b69c22ac9f675f6a4d0c0d796e8dae7823fd Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 1 Nov 2018 21:46:50 -0400 Subject: tests: Add testcases for -prune --- tests.sh | 16 ++++++++++++++++ tests/test_not_prune.out | 13 +++++++++++++ tests/test_prune.out | 3 +++ tests/test_prune_or_print.out | 13 +++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 tests/test_not_prune.out create mode 100644 tests/test_prune.out create mode 100644 tests/test_prune_or_print.out diff --git a/tests.sh b/tests.sh index 226bd34..3f22b22 100755 --- a/tests.sh +++ b/tests.sh @@ -233,6 +233,10 @@ posix_tests=( test_perm_leading_plus_symbolic_minus test_permcopy + test_prune + test_prune_or_print + test_not_prune + test_size test_size_plus test_size_bytes @@ -1315,6 +1319,18 @@ function test_permcopy() { bfs_diff perms -perm u+rw,g+u-w,o=g } +function test_prune() { + bfs_diff basic -name foo -prune +} + +function test_prune_or_print() { + bfs_diff basic -name foo -prune -o -print +} + +function test_not_prune() { + bfs_diff basic \! \( -name foo -prune \) +} + function test_ok_stdin() { # -ok should *not* close stdin # See https://savannah.gnu.org/bugs/?24561 diff --git a/tests/test_not_prune.out b/tests/test_not_prune.out new file mode 100644 index 0000000..40e2ea0 --- /dev/null +++ b/tests/test_not_prune.out @@ -0,0 +1,13 @@ +basic +basic/a +basic/b +basic/c +basic/e +basic/g +basic/i +basic/j +basic/k +basic/l +basic/c/d +basic/e/f +basic/g/h diff --git a/tests/test_prune.out b/tests/test_prune.out new file mode 100644 index 0000000..e9d47b1 --- /dev/null +++ b/tests/test_prune.out @@ -0,0 +1,3 @@ +basic/j/foo +basic/k/foo +basic/l/foo diff --git a/tests/test_prune_or_print.out b/tests/test_prune_or_print.out new file mode 100644 index 0000000..40e2ea0 --- /dev/null +++ b/tests/test_prune_or_print.out @@ -0,0 +1,13 @@ +basic +basic/a +basic/b +basic/c +basic/e +basic/g +basic/i +basic/j +basic/k +basic/l +basic/c/d +basic/e/f +basic/g/h -- cgit v1.2.3