From ebc9f6479da4c5b94e1b31b200a894732ab54063 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Sun, 22 Dec 2019 17:27:06 +0100 Subject: [PATCH] Sci: remove ns when error while loading --- sci | 2 +- .../babashka/src_for_classpath_test/ns_with_error.clj | 4 ++++ test/babashka/classpath_test.clj | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test-resources/babashka/src_for_classpath_test/ns_with_error.clj diff --git a/sci b/sci index acaca5fb..9144f5ae 160000 --- a/sci +++ b/sci @@ -1 +1 @@ -Subproject commit acaca5fb54e7b2f16ec87f32b045e88a9539272b +Subproject commit 9144f5ae29dc9fb710a58580411664647e848be5 diff --git a/test-resources/babashka/src_for_classpath_test/ns_with_error.clj b/test-resources/babashka/src_for_classpath_test/ns_with_error.clj new file mode 100644 index 00000000..d1f909ba --- /dev/null +++ b/test-resources/babashka/src_for_classpath_test/ns_with_error.clj @@ -0,0 +1,4 @@ +(ns ns-with-error) + +(def x 0) +(def y (/ 1 0)) diff --git a/test/babashka/classpath_test.clj b/test/babashka/classpath_test.clj index b3b876d3..06117332 100644 --- a/test/babashka/classpath_test.clj +++ b/test/babashka/classpath_test.clj @@ -25,3 +25,12 @@ (deftest main-test (is (= "(\"1\" \"2\" \"3\" \"4\")\n" (tu/bb nil "--classpath" "test-resources/babashka/src_for_classpath_test" "-m" "my.main" "1" "2" "3" "4")))) + +(deftest error-while-loading-test + (is (true? + (bb nil "--classpath" "test-resources/babashka/src_for_classpath_test" + " +(try + (require '[ns-with-error]) + (catch Exception nil)) +(nil? (resolve 'ns-with-error/x))"))))