Add a test for require in the body of a macro

This commit is contained in:
Brandon T. Willard 2018-07-25 17:13:05 -05:00
parent 33f2b4a91a
commit 65b2bd18ce
2 changed files with 12 additions and 1 deletions

View File

@ -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)))

View File

@ -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))