aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/test_clojure/other_functions.clj
diff options
context:
space:
mode:
authorFrantisek Sodomka <fsodomka@gmail.com>2009-05-14 21:17:05 +0000
committerFrantisek Sodomka <fsodomka@gmail.com>2009-05-14 21:17:05 +0000
commit514ec4c4c186363c2b7a6ec924e0960e02f477d7 (patch)
tree09d70150984eeb7d849df704294e8ffa0d849abe /src/clojure/contrib/test_clojure/other_functions.clj
parent710841407b7b2fbd24a0959fd121c662a5b1d2dd (diff)
test-clojure: other-functions: identity
Diffstat (limited to 'src/clojure/contrib/test_clojure/other_functions.clj')
-rw-r--r--src/clojure/contrib/test_clojure/other_functions.clj29
1 files changed, 28 insertions, 1 deletions
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