Skip to content

Instantly share code, notes, and snippets.

@timmc
Created April 19, 2011 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timmc/928528 to your computer and use it in GitHub Desktop.
Save timmc/928528 to your computer and use it in GitHub Desktop.
Alternative to clojure.test/are
(defmacro are
"Same as clojure.test/are, except returns true if all tests pass."
[syms test & vals]
(let [c (count syms)
points (partition-all c vals)]
(list `every?
`identity
(into []
(for [pt points]
`(let [~@(interleave syms pt)]
(is ~test)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment