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