hy/tests/native_tests/unless.hy
Julien Danjou f25177e9a6 Add a `unless' macro
Signed-off-by: Julien Danjou <julien@danjou.info>
2013-04-28 17:04:35 +02:00

9 lines
268 B
Hy

(defn test-unless []
"NATIVE: test unless"
(assert (= (unless false 1) 1))
(assert (= (unless false 1 2) 2))
(assert (= (unless false 1 3) 3))
(assert (= (unless true 2) null))
(assert (= (unless (!= 1 2) 42) null))
(assert (= (unless (!= 2 2) 42) 42)))