aboutsummaryrefslogtreecommitdiff
path: root/src/clojure
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure')
-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