• (are expr & args)
Checks multiple assertions with a template expression.
See clojure.contrib.template/do-template for an explanation of
templates.

Example: (are (= _1 _2)
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.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/test_is.clj:105 top

(defmacro are
  "Checks multiple assertions with a template expression.
  See clojure.contrib.template/do-template for an explanation of
  templates.

  Example: (are (= _1 _2)  
                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."
  [expr & args]
  `(do-template (is ~expr) ~@args))
Vars in clojure.contrib.test-is/are: defmacro concat list seq
Used in 0 other vars

Comments top

No comments for are. Log in to add a comment.