wip
This commit is contained in:
parent
6f10796622
commit
00ef12dfa5
2 changed files with 8 additions and 20 deletions
|
|
@ -139,10 +139,6 @@
|
|||
(ruler "Context")
|
||||
(println ec)
|
||||
(println))
|
||||
(when-let [locals (and (:debug opts) (not-empty (:locals d)))]
|
||||
(ruler "Locals")
|
||||
(print-locals locals)
|
||||
(println))
|
||||
(when sci-error?
|
||||
(when-let
|
||||
[st (let [st (with-out-str
|
||||
|
|
|
|||
|
|
@ -208,9 +208,6 @@ Location: <expr>:1:12
|
|||
1: (let [x 1] (/ x 0))
|
||||
^--- Divide by zero
|
||||
|
||||
----- Locals -------------------------------------------------------------------
|
||||
x: 1
|
||||
|
||||
----- Stack trace --------------------------------------------------------------
|
||||
clojure.core// - <built-in>
|
||||
user - <expr>:1:12
|
||||
|
|
@ -219,13 +216,13 @@ user - <expr>:1:12
|
|||
clojure.lang.ExceptionInfo: Divide by zero
|
||||
{:type :sci/error, :line 1, :column 12, :message \"Divide by zero\",")))))
|
||||
|
||||
(deftest macro-locals-print-test
|
||||
(testing "exception during macro call includes &form and &env locals"
|
||||
(let [output (try (tu/bb nil "--debug" "(defmacro foo [x] (subs nil 1) `(do ~x ~x)) (foo 1)")
|
||||
(is false)
|
||||
(catch Exception e (ex-message e)))]
|
||||
(is (str/includes? (tu/normalize output)
|
||||
"----- Error --------------------------------------------------------------------
|
||||
(deftest macro-test
|
||||
(let [output (try (tu/bb nil "--debug" "(defmacro foo [x] (subs nil 1) `(do ~x ~x)) (foo 1)")
|
||||
(is false)
|
||||
(catch Exception e (ex-message e)))
|
||||
output (tu/normalize output)]
|
||||
(is (str/includes? output
|
||||
"----- Error --------------------------------------------------------------------
|
||||
Type: java.lang.NullPointerException
|
||||
Location: <expr>:1:19
|
||||
Phase: macroexpand
|
||||
|
|
@ -234,11 +231,6 @@ Phase: macroexpand
|
|||
1: (defmacro foo [x] (subs nil 1) `(do ~x ~x)) (foo 1)
|
||||
^---
|
||||
|
||||
----- Locals -------------------------------------------------------------------
|
||||
&form: (foo 1)
|
||||
&env: {}
|
||||
x: 1
|
||||
|
||||
----- Stack trace --------------------------------------------------------------
|
||||
clojure.core/subs - <built-in>
|
||||
user/foo - <expr>:1:19
|
||||
|
|
@ -247,7 +239,7 @@ user - <expr>:1:45
|
|||
|
||||
----- Exception ----------------------------------------------------------------
|
||||
clojure.lang.ExceptionInfo: null
|
||||
{:type :sci/error, :line 1, :column 19,")))))
|
||||
{:type :sci/error, :line 1, :column 19"))))
|
||||
|
||||
(deftest native-stacktrace-test
|
||||
(let [output (try (tu/bb nil "(merge 1 2 3)")
|
||||
|
|
|
|||
Loading…
Reference in a new issue