diff options
author | Frantisek Sodomka <fsodomka@gmail.com> | 2009-05-18 18:48:30 +0000 |
---|---|---|
committer | Frantisek Sodomka <fsodomka@gmail.com> | 2009-05-18 18:48:30 +0000 |
commit | 3d791b3a84a0b248a476d53abe5528951af9c5b0 (patch) | |
tree | 7a4be0c34a91b71a5742228fa78e5a304471b6c0 /src/clojure/contrib/test_clojure/test_utils.clj | |
parent | e043c0fc73c392d2ef6127c5f7c695bbd1947169 (diff) |
test-clojure: test-utils: all-are; data-structures: rewritten tests using all-are
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)))) + |