diff --git a/script/test b/script/test index 774ab5a5..782beff1 100755 --- a/script/test +++ b/script/test @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -eo pipefail + if [ "$GRAALVM_HOME" != "" ] then export JAVA_HOME=$GRAALVM_HOME @@ -8,7 +10,6 @@ fi java -version -set -eo pipefail unset BABASHKA_PRELOADS unset BABASHKA_CLASSPATH unset BABASHKA_PRELOADS_TEST @@ -40,3 +41,12 @@ lein test :only babashka.pod-test export BABASHKA_SOCKET_REPL_TEST=true lein test :only babashka.impl.socket-repl-test + +# test invoking script in subdir with bb.edn in parent dir +unset BABASHKA_PRELOADS +pushd test-resources/bb_in_root_script_in_other_dir +if [[ $BABASHKA_TEST_ENV = "native" ]] +then + ../../bb dir/script.clj +fi +popd diff --git a/test-resources/bb_in_root_script_in_other_dir/bb.edn b/test-resources/bb_in_root_script_in_other_dir/bb.edn new file mode 100644 index 00000000..573466cb --- /dev/null +++ b/test-resources/bb_in_root_script_in_other_dir/bb.edn @@ -0,0 +1,2 @@ +{:deps {medley/medley {:mvn/version "1.3.0"}}} + diff --git a/test-resources/bb_in_root_script_in_other_dir/dir/script.clj b/test-resources/bb_in_root_script_in_other_dir/dir/script.clj new file mode 100755 index 00000000..c28aa58d --- /dev/null +++ b/test-resources/bb_in_root_script_in_other_dir/dir/script.clj @@ -0,0 +1,6 @@ +#!/usr/bin/env bb + +(ns script + (:require [medley.core :as medley])) + +(prn (medley/index-by :id [{:id 1}]))