Start work on marshalling in Python bindings

This commit is contained in:
John J. Camilleri
2021-09-03 14:14:47 +02:00
parent 2daf9e2e19
commit 3ecb937753
7 changed files with 1362 additions and 1206 deletions

View File

@@ -83,3 +83,32 @@ def test_functionsByCat_2(PGF):
def test_functionsByCat_non_existant(PGF):
assert PGF.functionsByCat("X") == []
def test_readType_invalid():
with pytest.raises(pgf.PGFError):
pgf.readType("->")
def test_readType_equality_1():
assert pgf.readType("A") == pgf.readType("A")
def test_readType_equality_2():
assert pgf.readType("A -> B") == pgf.readType("A->B")
def test_readType_inequality_1():
assert pgf.readType("A") != pgf.readType("B")
def test_readType_inequality_2():
assert pgf.readType("A -> B") != pgf.readType("B->B")
def test_functionType_1(PGF):
assert PGF.functionType("z") == pgf.readType("N")
def test_functionType_2(PGF):
assert PGF.functionType("s") == pgf.readType("N->N")
def test_functionType_3(PGF):
assert PGF.functionType("c") == pgf.readType("N -> S")
def test_startCat(PGF):
with pytest.raises(pgf.PGFError):
PGF.startCat()