cleaning up the tests a bit

This commit is contained in:
Paul Tagliamonte 2013-04-01 20:00:37 -04:00
parent 678ef441e5
commit 025e501b13
3 changed files with 17 additions and 6 deletions

View File

@ -38,7 +38,7 @@ def test_ast_bad_type():
"Make sure AST breakage can happen"
try:
hy_compile("foo")
assert True == False
assert True is False
except HyCompileError:
pass
@ -72,7 +72,18 @@ def test_ast_non_decoratable():
""" Ensure decorating garbage breaks """
try:
hy_compile(tokenize("(decorate-with (foo) (* x x))"))
assert True == False
assert True is False
except TypeError:
pass
def test_ast_non_kwapplyable():
""" Ensure kwapply breaks """
code = tokenize("(kwapply foo bar)")
code[0][2] = None
try:
hy_compile(code)
assert True is False
except TypeError:
pass

View File

@ -33,13 +33,13 @@ def test_lex_exception():
""" Ensure tokenize throws a fit on a partial input """
try:
objs = tokenize("(foo")
assert True == False
assert True is False
except LexException:
pass
try:
objs = tokenize("&foo&")
assert True == False
assert True is False
except LexException:
pass

View File

@ -78,8 +78,8 @@
(defn test-cond []
"NATIVE: test if cond sorta works."
(cond
((= 1 2) (assert (= true false)))
((is null null) (assert (= true true)))))
((= 1 2) (assert (is true false)))
((is null null) (assert (is true true)))))
(defn test-index []