hy/tests/native_tests/when.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
248 B
Hy

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