Haven't gotten around to writing unit tests for macros, but if I did I think I would use macroexpand-1 and assert that it expanded into the form I was expecting. For example let's say I wanted to write a test for the 'defn' macro
If it worked correctly then the following expression should be true
(= (macroexpand-1 '(defn foo [x y] (+ x y)))
'(def foo (clojure.core/fn ([x y] (+ x y)))))
and it is, because (defn foo [x y] (+ x y)) does in fact expand out to (def foo (clojure.core/fn ([x y] (+ x y))))
--
Cosmin Stejerean
http://offbytwo.com