From 634084e5921e51426f9eb3b892c433340b7bdecb Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Fri, 31 Jan 2020 22:31:16 +0100 Subject: [PATCH] [#251] Test for uberscript with System/exit --- test/babashka/main_test.clj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/babashka/main_test.clj b/test/babashka/main_test.clj index 66c4a961..a4c2cb35 100644 --- a/test/babashka/main_test.clj +++ b/test/babashka/main_test.clj @@ -330,6 +330,12 @@ (testing "the clojure.lang.MapEntry constructor works" (is (true? (bb nil "(= (first {1 2}) (clojure.lang.MapEntry. 1 2))"))))) +(deftest uberscript-test + (let [tmp-file (java.io.File/createTempFile "uberscript" ".clj")] + (.deleteOnExit tmp-file) + (is (empty? (bb nil "--uberscript" (.getPath tmp-file) "-e" "(System/exit 1)"))) + (is (= "(System/exit 1)" (slurp tmp-file))))) + ;;;; Scratch (comment