diff options
Diffstat (limited to 'src/clojure/contrib/test_clojure/test_utils.clj')
-rw-r--r-- | src/clojure/contrib/test_clojure/test_utils.clj | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/clojure/contrib/test_clojure/test_utils.clj b/src/clojure/contrib/test_clojure/test_utils.clj index 6fe22161..fc858f2d 100644 --- a/src/clojure/contrib/test_clojure/test_utils.clj +++ b/src/clojure/contrib/test_clojure/test_utils.clj @@ -16,3 +16,18 @@ [] (throw (new Exception "Exception which should never occur"))) + +(defmacro all-are + "Test all-with-all. + (all-are (= _1 _2) + a b c) + => + (do + (is (= a b)) + (is (= a c)) + (is (= b c)))" + [expr & args] + (concat + (list 'clojure.contrib.template/do-template (list 'clojure.contrib.test-is/is expr)) + (apply concat (combinations args 2)))) + |