From 455b724279c1cb4aefc0d2f81b65641990dd7689 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 16 Apr 2017 11:00:49 -0400 Subject: tests: Add tests for bfs extensions to -exec ... + --- tests.sh | 10 ++++++++++ tests/test_exec_plus_substring.out | 1 + tests/test_execdir_plus_substring.out | 11 +++++++++++ 3 files changed, 22 insertions(+) create mode 100644 tests/test_exec_plus_substring.out create mode 100644 tests/test_execdir_plus_substring.out diff --git a/tests.sh b/tests.sh index 0c83beb..db223ab 100755 --- a/tests.sh +++ b/tests.sh @@ -304,7 +304,9 @@ bfs_tests=( test_perm_symbolic_missing_action test_perm_leading_plus_symbolic test_perm_octal_plus + test_exec_plus_substring test_execdir_plus + test_execdir_plus_substring test_hidden test_nohidden test_path_flag_expr @@ -658,6 +660,10 @@ function test_exec_substring() { bfs_diff basic -exec echo '-{}-' ';' } +function test_exec_plus_substring() { + bfs_diff basic -exec "$TESTS/sort-args.sh" a '-{}-' z + +} + function test_execdir() { bfs_diff basic -execdir echo '{}' ';' } @@ -670,6 +676,10 @@ function test_execdir_substring() { bfs_diff basic -execdir echo '-{}-' ';' } +function test_execdir_plus_substring() { + bfs_diff basic -execdir "$TESTS/sort-args.sh" a '-{}-' z + +} + function test_execdir_pwd() { local TMP_REAL="$(cd "$TMP" && pwd)" local OFFSET="$((${#TMP_REAL} + 2))" diff --git a/tests/test_exec_plus_substring.out b/tests/test_exec_plus_substring.out new file mode 100644 index 0000000..7e5bb34 --- /dev/null +++ b/tests/test_exec_plus_substring.out @@ -0,0 +1 @@ +-basic- -basic/a- -basic/b- -basic/c- -basic/c/d- -basic/e- -basic/e/f- -basic/g- -basic/g/h- -basic/i- -basic/j- -basic/j/foo- -basic/k- -basic/k/foo- -basic/k/foo/bar- -basic/l- -basic/l/foo- -basic/l/foo/bar- -basic/l/foo/bar/baz- a z diff --git a/tests/test_execdir_plus_substring.out b/tests/test_execdir_plus_substring.out new file mode 100644 index 0000000..838fbae --- /dev/null +++ b/tests/test_execdir_plus_substring.out @@ -0,0 +1,11 @@ +-./bar- a z +-./bar- a z +-./basic- a z +-./baz- a z +-./d- a z +-./f- a z +-./foo- a z +-./foo- a z +-./foo- a z +-./h- a z +-./a- -./b- -./c- -./e- -./g- -./i- -./j- -./k- -./l- a z -- cgit v1.2.3