title: Lisp unit tests for macros conventions and best practices
body: <p>I find it hard to reason about macro-expansion and was wondering what the best practices were for testing them.</p>
  
  <p>So if I have a macro, I can perform one level of macro expansion via <code>macroexpand-1</code>.</p>
  
  <pre><code>(defmacro incf-twice (n)
    `(progn
       (incf ,n)
       (incf ,n)))
  </code></pre>
  
  <p>for example</p>
  
  <pre><code>(macroexpand-1 '(incf-twice n))
  </code></pre>
  
  <p>evaluates to</p>
  
  <pre><code>(PROGN (INCF N) (INCF N))
  </code></pre>
  
  <p>It seems simple enough to turn this into a test for the macro.</p>
  
  <pre><code>(equalp (macroexpand-1 '(incf-twice n))
    '(progn (incf n) (incf n)))
  </code></pre>
  
  <p>Is there an established convention for organizing tests for macros? Also, is there a library for summarizing differences between s-expressions?</p>