From 007c182da7bda9836ddabca372ec8407ca26ade7 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Tue, 22 Sep 2020 11:54:51 +0200 Subject: [PATCH] Fix for borkdude/sci#421 --- sci | 2 +- test/babashka/error_test.clj | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sci b/sci index 2f3760eb..fba06e91 160000 --- a/sci +++ b/sci @@ -1 +1 @@ -Subproject commit 2f3760eb7c3f129adf044dadbe75ebed5f27921f +Subproject commit fba06e91adf38568f82fce6323610501f57d44c3 diff --git a/test/babashka/error_test.clj b/test/babashka/error_test.clj index 3a0bfa91..857ca787 100644 --- a/test/babashka/error_test.clj +++ b/test/babashka/error_test.clj @@ -136,19 +136,21 @@ user/foo - :1:1 user - :1:45"))) (deftest error-in-macroexpansion-test - (let [output (try (tu/bb nil "-e" "(defmacro foo [x & xs] `(do (subs nil 1) ~x)) (foo 1)") + (let [output (try (tu/bb nil "-e" "(defmacro foo [x] `(subs nil ~x)) (foo 1)") (catch Exception e (ex-message e)))] (multiline-equals output "----- Error -------------------------------------------------------------------- Type: java.lang.NullPointerException -Location: :1:47 +Location: :1:35 ----- Context ------------------------------------------------------------------ -1: (defmacro foo [x & xs] `(do (subs nil 1) ~x)) (foo 1) - ^--- +1: (defmacro foo [x] `(subs nil ~x)) (foo 1) + ^--- ----- Stack trace -------------------------------------------------------------- -clojure.core/subs - ")) +clojure.core/subs - +user - :1:35 +")) (testing "calling a var inside macroexpansion" (let [output (try (tu/bb nil "-e" "(defn quux [] (subs nil 1)) (defmacro foo [x & xs] `(do (quux) ~x)) (defn bar [] (foo 1)) (bar)") (catch Exception e (ex-message e)))]