Add a few tests for various defn corner cases
Closes #302. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This commit is contained in:
parent
2665b316cf
commit
1327d58882
@ -519,3 +519,11 @@ def test_attribute_access():
|
||||
def test_cons_correct():
|
||||
"""Ensure cons gets compiled correctly"""
|
||||
can_compile("(cons a b)")
|
||||
|
||||
|
||||
def test_defn():
|
||||
"""Ensure that defn works correctly in various corner cases"""
|
||||
cant_compile("(defn if [] 1)")
|
||||
cant_compile("(defn \"hy\" [] 1)")
|
||||
cant_compile("(defn :hy [] 1)")
|
||||
can_compile("(defn &hy [] 1)")
|
||||
|
@ -673,6 +673,12 @@
|
||||
(assert (= 43 (my-fun 42))))
|
||||
|
||||
|
||||
(defn test-defn-lambdakey []
|
||||
"NATIVE: test defn with a &symbol function name"
|
||||
(defn &hy [] 1)
|
||||
(assert (= (&hy) 1)))
|
||||
|
||||
|
||||
(defn test-defn-do []
|
||||
"NATIVE: test defn evaluation order with do"
|
||||
(setv acc [])
|
||||
|
Loading…
Reference in New Issue
Block a user