Created
April 19, 2011 15:44
-
-
Save timmc/928528 to your computer and use it in GitHub Desktop.
Alternative to clojure.test/are
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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