2013-04-28 16:57:29 +02:00
|
|
|
(defn test-when []
|
|
|
|
"NATIVE: test when"
|
|
|
|
(assert (= (when true 1) 1))
|
|
|
|
(assert (= (when true 1 2) 2))
|
|
|
|
(assert (= (when true 1 3) 3))
|
|
|
|
(assert (= (when false 2) null))
|
|
|
|
(assert (= (when (= 1 2) 42) null))
|
2013-12-27 21:50:19 +01:00
|
|
|
(assert (= (when false 2) nil))
|
|
|
|
(assert (= (when (= 1 2) 42) nil))
|
2013-04-28 16:57:29 +02:00
|
|
|
(assert (= (when (= 2 2) 42) 42)))
|