This is not possible arein clojure.test ..
I adjusted Stuart Sierra areto support the script testingand error message as follows:
(defmacro my-are
[scenario fail-msg argv expr & args]
(if (or
(and (empty? argv) (empty? args))
(and (pos? (count argv))
(pos? (count args))
(zero? (mod (count args) (count argv)))))
`(testing ~scenario
(clojure.template/do-template ~argv (is ~expr ~fail-msg) ~@args))
(throw (IllegalArgumentException. "The number of args doesn't match are argv."))))
Now the tests are completed in the script testingand error messages are added.
This macro can be used as follows:
(deftest my-test
(my-are "Scenario 1: testing arithmetic" "Testing my stuff failed"
[x y] (= x y)
2 (- 4 1)
4 (* 2 2)
5 (/ 10 2)))
It leads to:
1
3- , 1
1
1 :
1:
: (= 2 (- 4 1))
actual: (not (= 2 3))
, , ( " ) , , (" 1: ").