Test fix: most exprs no longer have types

This commit is contained in:
Reid 'arrdem' McKenzie 2020-07-18 21:02:03 -06:00
parent 2122a15759
commit fef3df7f64

View file

@ -33,17 +33,17 @@ def test_analyze_constants(txt, exprtype):
assert isinstance(a.analyzes(txt), exprtype)
@pytest.mark.parametrize('txt, exprtype, rettype', [
('()', a.ListExpr, None),
('(list)', a.ListExpr, None),
('(list 1)', a.ListExpr, a.BuiltinType.INTEGER),
('(do 1)', a.DoExpr, a.BuiltinType.INTEGER),
('(do foo bar 1)', a.DoExpr, a.BuiltinType.INTEGER),
('(let [a 1] 1)', a.LetExpr, a.BuiltinType.INTEGER),
('(fn [] 1)', a.FnExpr, a.BuiltinType.INTEGER),
('(fn [] ⊢ integer? x)', a.FnExpr, p.SymbolToken('integer?', None, None)),
@pytest.mark.parametrize('txt', [
'()',
'(list)',
'(list 1)',
'(do 1)',
'(do foo bar 1)',
'(let [a 1, b 2] 1)',
'(fn [] 1)',
'(fn [] ⊢ integer? x)',
'(fn [] x |- integer?)',
])
def test_analyze_rettype(txt, exprtype, rettype):
def test_analyze(txt):
"""Make sure that do exprs work."""
assert isinstance(a.analyzes(txt), exprtype)
assert a.analyzes(txt).type == rettype
assert a.analyzes(txt)