summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-07-12 23:48:39 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-07-12 23:49:07 -0400
commit46e3798fbaa5c41d73651e814f9f3212ab4c20eb (patch)
tree9b87bde407d86206279cebb155fda33f8baa46ee
parentb06a87622065fb4c1c86bc7d5638bd6f46c9648f (diff)
downloadbfs-46e3798fbaa5c41d73651e814f9f3212ab4c20eb.tar.xz
tests: New test for -exec with unset $PATH
-rw-r--r--tests/test_exec_nopath.out19
-rwxr-xr-xtests/tests.sh11
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_exec_nopath.out b/tests/test_exec_nopath.out
new file mode 100644
index 0000000..a7ccfe4
--- /dev/null
+++ b/tests/test_exec_nopath.out
@@ -0,0 +1,19 @@
+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
diff --git a/tests/tests.sh b/tests/tests.sh
index 64a5c0e..aec670a 100755
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -253,6 +253,7 @@ posix_tests=(
test_L_depth
test_exec
+ test_exec_nopath
test_exec_plus
test_exec_plus_status
test_exec_plus_semicolon
@@ -1752,6 +1753,16 @@ function test_exec() {
bfs_diff basic -exec echo {} \;
}
+function test_exec_nopath() {
+ (
+ unset PATH
+ invoke_bfs basic -exec echo {} \; >"$OUT"
+ )
+
+ sort_output
+ diff_output
+}
+
function test_exec_nothing() {
# Regression test: don't segfault on missing command
fail invoke_bfs basic -exec \;