From 514ec4c4c186363c2b7a6ec924e0960e02f477d7 Mon Sep 17 00:00:00 2001 From: Frantisek Sodomka Date: Thu, 14 May 2009 21:17:05 +0000 Subject: test-clojure: other-functions: identity --- .../contrib/test_clojure/other_functions.clj | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/clojure/contrib/test_clojure/other_functions.clj') diff --git a/src/clojure/contrib/test_clojure/other_functions.clj b/src/clojure/contrib/test_clojure/other_functions.clj index 6175891c..3138fbd9 100644 --- a/src/clojure/contrib/test_clojure/other_functions.clj +++ b/src/clojure/contrib/test_clojure/other_functions.clj @@ -13,7 +13,34 @@ ; [= not= (tests in data_structures.clj and elsewhere)] -; identity + +(deftest test-identity + ; exactly 1 argument needed + (is (thrown? IllegalArgumentException (identity))) + (is (thrown? IllegalArgumentException (identity 1 2))) + + (are (= (identity _) _) + nil + false true + 0 42 + 0.0 3.14 + 2/3 + 0M 1M + \c + "" "abc" + 'sym + :kw + () '(1 2) + [] [1 2] + {} {:a 1 :b 2} + #{} #{1 2} ) + + ; evaluation + (are (= (identity _1) _2) + (+ 1 2) 3 + (> 5 0) true )) + + ; time assert comment doc ; partial -- cgit v1.2.3-18-g5258