Merge pull request #1399 from Kodiologist/compiler-refactor

This commit is contained in:
Ryan Gonzalez 2017-09-15 14:44:32 -05:00
commit 3f69ed8e8e
3 changed files with 311 additions and 698 deletions

File diff suppressed because it is too large Load Diff

View File

@ -9,18 +9,6 @@ from hy.models import HyExpression, HyList, HySymbol, HyInteger
from hy._compat import PY3
def test_builds_with_dash():
assert callable(compiler.builds("foobar"))
assert callable(compiler.builds("foo_bar"))
assert callable(compiler.builds("-"))
try:
compiler.builds("foobar-with-dash-")
except TypeError as e:
assert "*post* translated strings" in str(e)
else:
assert False
def make_expression(*args):
h = HyExpression(args)
h.start_line = 1

View File

@ -1631,3 +1631,14 @@
"Make sure argument destructuring works"
(defn f [[a b] [c]] (, a b c))
(assert (= (f [1 2] [3]) (, 1 2 3))))
#@(pytest.mark.xfail
(defn test-assert-multistatements []
; https://github.com/hylang/hy/issues/1390
(setv s (set))
(defn f [x]
(.add s x)
False)
(with [(pytest.raises AssertionError)]
(assert (do (f 1) (f 2)) (do (f 3) (f 4))))
(assert (= s #{1 2 3 4}))))