Merge pull request #1399 from Kodiologist/compiler-refactor
This commit is contained in:
commit
3f69ed8e8e
986
hy/compiler.py
986
hy/compiler.py
File diff suppressed because it is too large
Load Diff
@ -9,18 +9,6 @@ from hy.models import HyExpression, HyList, HySymbol, HyInteger
|
|||||||
from hy._compat import PY3
|
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):
|
def make_expression(*args):
|
||||||
h = HyExpression(args)
|
h = HyExpression(args)
|
||||||
h.start_line = 1
|
h.start_line = 1
|
||||||
|
@ -1631,3 +1631,14 @@
|
|||||||
"Make sure argument destructuring works"
|
"Make sure argument destructuring works"
|
||||||
(defn f [[a b] [c]] (, a b c))
|
(defn f [[a b] [c]] (, a b c))
|
||||||
(assert (= (f [1 2] [3]) (, 1 2 3))))
|
(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}))))
|
||||||
|
Loading…
Reference in New Issue
Block a user