cljs.test/are
(are argv expr & args)
Source docstring:
Checks multiple assertions with a template expression.
See clojure.template/do-template for an explanation of
templates.
Example: (are [x y] (= x y)
2 (+ 1 1)
4 (* 2 2))
Expands to:
(do (is (= 2 (+ 1 1)))
(is (= 4 (* 2 2))))
Note: This breaks some reporting features, such as line numbers.
(defmacro are
[argv expr & args]
(if (or
(and (empty? argv) (empty? args))
(and (pos? (count argv))
(pos? (count args))
(zero? (mod (count args) (count argv)))))
`(clojure.template/do-template ~argv (is ~expr) ~@args)
(throw (#?(:clj Exception. :cljs js/Error.) "The number of args doesn't match are's argv."))))