Here is the passing version of the code:
Normal function: That passes
(defn my-fn
[]
(throw (IllegalStateException.)))
(fact
(my-fn) => (throws IllegalStateException))
Here is the macro version of it:
(defmacro my-fn
[]
(throw (IllegalStateException.)))
(fact
(my-fn) => (throws IllegalStateException))
Which fails here is the output:
LOAD FAILURE for example.dsl.is-test
java.lang.IllegalStateException, compiling:(example/dsl/is_test.clj:14:3)
The exception has been stored in #'*me, so `(pst *me)` will show the stack trace.
FAILURE: 1 check failed. (But 12 succeeded.)
It is the same code I just changed defn to defmacro.
I did not understand that why this is not working?