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" "Make sure AST breakage can happen"
try: try:
hy_compile("foo") hy_compile("foo")
assert True == False assert True is False
except HyCompileError: except HyCompileError:
pass pass
@ -72,7 +72,18 @@ def test_ast_non_decoratable():
""" Ensure decorating garbage breaks """ """ Ensure decorating garbage breaks """
try: try:
hy_compile(tokenize("(decorate-with (foo) (* x x))")) 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: except TypeError:
pass pass

View File

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

View File

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