Add a test for require
in the body of a macro
This commit is contained in:
parent
33f2b4a91a
commit
65b2bd18ce
@ -56,7 +56,15 @@
|
|||||||
(do '(with [b 2])
|
(do '(with [b 2])
|
||||||
`(with [c 3]
|
`(with [c 3]
|
||||||
~(with* [d 4] (do))
|
~(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 []
|
(defn test-let-basic []
|
||||||
(assert (zero? (let [a 0] a)))
|
(assert (zero? (let [a 0] a)))
|
||||||
|
@ -7,3 +7,6 @@
|
|||||||
(defn f [&rest args] (.join "" (+ (, "c") args)))
|
(defn f [&rest args] (.join "" (+ (, "c") args)))
|
||||||
(setv variable (HySymbol (->> "d" (f))))
|
(setv variable (HySymbol (->> "d" (f))))
|
||||||
`(setv ~variable 5))
|
`(setv ~variable 5))
|
||||||
|
|
||||||
|
(defmacro test-macro []
|
||||||
|
'(setv blah 1))
|
||||||
|
Loading…
Reference in New Issue
Block a user