2013-04-28 16:57:29 +02:00
|
|
|
(defn test-when []
|
|
|
|
"NATIVE: test when"
|
2016-11-24 03:35:17 +01:00
|
|
|
(assert (= (when True 1) 1))
|
|
|
|
(assert (= (when True 1 2) 2))
|
|
|
|
(assert (= (when True 1 3) 3))
|
|
|
|
(assert (= (when False 2) None))
|
2015-08-12 00:22:13 +02:00
|
|
|
(assert (= (when (= 1 2) 42) None))
|
2013-04-28 16:57:29 +02:00
|
|
|
(assert (= (when (= 2 2) 42) 42)))
|