hy/tests/native_tests/unless.hy

9 lines
268 B
Hy
Raw Normal View History

(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) None))
(assert (= (unless (!= 1 2) 42) None))
(assert (= (unless (!= 2 2) 42) 42)))