diff --git a/tests/native_tests/contrib/walk.hy b/tests/native_tests/contrib/walk.hy index 730fd45..a93e3bf 100644 --- a/tests/native_tests/contrib/walk.hy +++ b/tests/native_tests/contrib/walk.hy @@ -56,7 +56,15 @@ (do '(with [b 2]) `(with [c 3] ~(with* [d 4] (do)) - ~@[(with* [e 5] (do))])))))) + ~@[(with* [e 5] (do))]))))) + + (defmacro require-macro [] + `(do + (require [tests.resources.macros [test-macro :as my-test-macro]]) + (my-test-macro))) + + (assert (= (last (macroexpand-all '(require-macro))) + '(setv blah 1)))) (defn test-let-basic [] (assert (zero? (let [a 0] a))) diff --git a/tests/resources/macros.hy b/tests/resources/macros.hy index 0f5dcbe..300a790 100644 --- a/tests/resources/macros.hy +++ b/tests/resources/macros.hy @@ -7,3 +7,6 @@ (defn f [&rest args] (.join "" (+ (, "c") args))) (setv variable (HySymbol (->> "d" (f)))) `(setv ~variable 5)) + +(defmacro test-macro [] + '(setv blah 1))