[#243] ns form doesn't work with socket repl
This commit is contained in:
parent
e2cf871dfa
commit
9269f1087f
2 changed files with 6 additions and 2 deletions
|
|
@ -14,7 +14,8 @@
|
|||
:no-doc true}
|
||||
babashka.impl.clojure.core.server
|
||||
(:refer-clojure :exclude [locking])
|
||||
(:require [sci.core :as sci])
|
||||
(:require [sci.core :as sci]
|
||||
[sci.impl.vars :as vars])
|
||||
(:import
|
||||
[clojure.lang LineNumberingPushbackReader]
|
||||
[java.net InetAddress Socket ServerSocket SocketException]
|
||||
|
|
@ -44,7 +45,8 @@
|
|||
(try
|
||||
(sci/with-bindings {sci/in in
|
||||
sci/out out
|
||||
sci/err err}
|
||||
sci/err err
|
||||
vars/current-ns (vars/->SciNamespace 'user)}
|
||||
(swap! server assoc-in [:sessions client-id] {})
|
||||
(apply accept args))
|
||||
(catch SocketException _disconnect)
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@
|
|||
(is (socket-command "#?(:bb 1337 :clj 8888)" "1337")))
|
||||
(testing "*1, *2, *3, *e"
|
||||
(is (socket-command "1\n*1" "1")))
|
||||
(testing "*ns*"
|
||||
(is (socket-command "(ns foo.bar) (ns-name *ns*)" "foo.bar")))
|
||||
(finally
|
||||
(if tu/jvm?
|
||||
(stop-repl!)
|
||||
|
|
|
|||
Loading…
Reference in a new issue