hy/tests/native_tests/unless.hy
Kodi Arfer ed8e37da62 Burninate the synonyms true, false, and nil
Per the straw poll in #908, as an alternative to #1147.

Now you must use `True`, `False`, and `None`, as in Python. Or just assign `true` to `True`, etc.; the old synonyms aren't reserved words anymore.
2016-11-23 18:35:17 -08: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) None))
(assert (= (unless (!= 1 2) 42) None))
(assert (= (unless (!= 2 2) 42) 42)))