fix: pr-str/str of a var, and nREPL namespace switching
- core: pr-render/str-render now render a Jolt var as #'ns/name instead of
falling through to the generic table printer, which recursed into the var's
cyclic :meta/:ns refs and looped forever. Adds name-of/var-display helpers.
- jolt.nrepl: capture the post-eval namespace *after* running the form — jolt
evaluates map-literal values right-to-left, so {:val (eval form) :ns (the-ns)}
read the ns before in-ns ran, pinning every session to 'user'. Now in-ns/ns
switches persist across evals. render-value dropped: pr-str handles vars.
- specs: var printing (strings-spec) and nREPL in-ns/ns-persistence + explicit
:ns override (nrepl-test).
This commit is contained in:
parent
5b66cfaa97
commit
d00c3cc117
4 changed files with 38 additions and 7 deletions
|
|
@ -64,6 +64,14 @@
|
|||
(check "ns field reported"
|
||||
"(some #(get % \"ns\") (jolt.nrepl/client-eval c \"(+ 1 1)\" s))" "user")
|
||||
|
||||
# in-ns switches the session ns, and it persists to the next eval
|
||||
(check "in-ns switches ns"
|
||||
"(some #(get % \"ns\") (jolt.nrepl/client-eval c \"(in-ns (quote foo.bar))\" s))" "foo.bar")
|
||||
(check "ns persists across evals"
|
||||
"(some #(get % \"ns\") (jolt.nrepl/client-eval c \"(+ 2 2)\" s))" "foo.bar")
|
||||
# explicit :ns on the message overrides
|
||||
(ev "(jolt.nrepl/request c {\"op\" \"eval\" \"code\" \"(+ 1 1)\" \"session\" s \"ns\" \"user\"})")
|
||||
|
||||
# eval error -> eval-error status, and the connection keeps working afterward
|
||||
(check "eval error status"
|
||||
"(boolean (some #(let [st (get % \"status\")] (and (sequential? st) (some (fn [x] (= \"eval-error\" x)) st))) (jolt.nrepl/client-eval c \"(/ 1 :z)\" s)))"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue