From a5be01c740f426e74ed774902b059482f4ac9130 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Sat, 7 Dec 2019 23:10:34 +0100 Subject: [PATCH] Socket repl tests fix --- sci | 2 +- test/babashka/impl/socket_repl_test.clj | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sci b/sci index f1778710..60778bfa 160000 --- a/sci +++ b/sci @@ -1 +1 @@ -Subproject commit f1778710e94d4e12dfce7dccb6ee0a301eccefcc +Subproject commit 60778bfaabf4fbed635d9490bac88b86fdfb0e4d diff --git a/test/babashka/impl/socket_repl_test.clj b/test/babashka/impl/socket_repl_test.clj index b43eb5c8..df9f4f62 100644 --- a/test/babashka/impl/socket_repl_test.clj +++ b/test/babashka/impl/socket_repl_test.clj @@ -21,8 +21,7 @@ (when-let [l (.readLine ^java.io.BufferedReader reader)] (binding [*out* sw] (println l)) - (when-not (str/includes? l expected) - (recur)))) + (recur))) (let [s (str sw)] (is (str/includes? s expected) (format "\"%s\" does not contain \"%s\"" @@ -46,15 +45,15 @@ (while (not (zero? (:exit (sh "bash" "-c" "lsof -t -i:1666")))))) - (is (socket-command '(+ 1 2 3) "user=> 6")) + (is (socket-command "(+ 1 2 3)" "user=> 6")) (testing "*in*" (is (socket-command "*in*" "[1 2 3]"))) (testing "*command-line-args*" (is (socket-command '*command-line-args* "\"a\" \"b\" \"c\""))) (testing "&env" - (socket-command '(defmacro bindings [] (mapv #(list 'quote %) (keys &env))) "") - (socket-command '(defn bar [x y z] (bindings)) "") - (is (socket-command '(bar 1 2 3) "[x y z]"))) + (socket-command "(defmacro bindings [] (mapv #(list 'quote %) (keys &env)))" "bindings") + (socket-command "(defn bar [x y z] (bindings))" "bar") + (is (socket-command "(bar 1 2 3)" "[x y z]"))) (testing "reader conditionals" (is (socket-command "#?(:bb 1337 :clj 8888)" "1337"))) (testing "*1, *2, *3, *e" @@ -69,7 +68,8 @@ (comment (socket-repl-test) - (t/run-tests) + (dotimes [_ 1000] + (t/run-tests)) (stop-repl!) (start-repl! "0.0.0.0:1666" {:bindings {(with-meta '*in* {:sci/deref! true})