Merge branch 'master' onto pr/395

This commit is contained in:
Abhishek L 2013-12-31 03:37:26 +05:30
commit 0a80b87b7f
4 changed files with 9 additions and 3 deletions

View File

@ -229,6 +229,7 @@ def t_identifier(p):
table = {
"true": "True",
"false": "False",
"nil": "None",
"null": "None",
}

View File

@ -86,9 +86,10 @@
(defn test-is []
"NATIVE: test is can deal with None"
(setv a null)
(assert (is a null))
(assert (is-not a "b")))
(setv a nil)
(assert (is a nil))
(assert (is-not a "b"))
(assert (none? a)))
(defn test-branching []

View File

@ -4,5 +4,7 @@
(assert (= (unless false 1 2) 2))
(assert (= (unless false 1 3) 3))
(assert (= (unless true 2) null))
(assert (= (unless true 2) nil))
(assert (= (unless (!= 1 2) 42) null))
(assert (= (unless (!= 1 2) 42) nil))
(assert (= (unless (!= 2 2) 42) 42)))

View File

@ -5,4 +5,6 @@
(assert (= (when true 1 3) 3))
(assert (= (when false 2) null))
(assert (= (when (= 1 2) 42) null))
(assert (= (when false 2) nil))
(assert (= (when (= 1 2) 42) nil))
(assert (= (when (= 2 2) 42) 42)))