1
0
forked from GitHub/gf-core

Type initialiser accepts sequences, stores internally as tuples. Add tests which try to break things.

This commit is contained in:
John J. Camilleri
2021-09-28 11:58:22 +02:00
parent 388829d63d
commit 16eb5f1a89
7 changed files with 162 additions and 112 deletions

View File

@@ -219,9 +219,11 @@ def test_Type_getters():
h0 = mkDepHypo("x", Type([], "N", []))
e0 = ExprVar(0)
type = Type([h0], "N", [e0])
assert type.hypos == [h0]
assert len(type.hypos) == 1
assert type.hypos[0] == h0
assert type.cat == "N"
assert type.exprs == [e0]
assert len(type.exprs) == 1
assert type.exprs[0] == e0
with pytest.raises(AttributeError):
type.fake