Hi Frantisek,
I think I understand what you're looking for here, but I don't see how
to make it work. If "are" could be applied to a generated list, then
it would have to evaluate its arguments, which is a pretty fishy thing
for a macro to do. (But possible -- check out clojure.contrib.apply-
macro). Here's how I would write this sequence of assertions:
(deftest zeros-are-equal
(doall (map (fn [[a b]] (is (= a b)))
(combinations [0 0.0 0M] 2))))
To answer your other question, if you want a message on each
assertion, just use "is". That's why I've never been crazy about
"are", I feel like it encourages too much succinctness. You also lose
accurate line numbers in error reports.
But if you want, you can use "do-template" in
clojure.contrib.template, which is how "are" is implemented.
(deftest my-test
(do-template (is (= _1 _2) _3)
4 (+ 2 2) "simple arithmetic"
5 (+ 2 2) "bad arithmetic"))
-Stuart Sierra