1
0
forked from GitHub/gf-core

Add bootNGF. Organise tests better.

This commit is contained in:
John J. Camilleri
2021-10-04 15:07:23 +02:00
parent 7551926383
commit 1f72ef77c4
4 changed files with 103 additions and 38 deletions

View File

@@ -8,7 +8,7 @@ from pgf import *
def PGF():
return readPGF("../haskell/tests/basic.pgf")
def test_readPGF_non_existant():
def test_readPGF_non_existent():
with pytest.raises(FileNotFoundError):
readPGF("../haskell/tests/abc.pgf")
@@ -28,7 +28,7 @@ def NGF():
yield ngf
os.remove("./basic.ngf")
def test_bootNGF_non_existant():
def test_bootNGF_non_existent():
with pytest.raises(FileNotFoundError):
bootNGF("../haskell/tests/abc.pgf", "./abc.ngf")
@@ -46,7 +46,7 @@ def test_bootNGF_existing(NGF):
# readNGF
def test_readNGF_non_existant():
def test_readNGF_non_existent():
with pytest.raises(FileNotFoundError):
readNGF("./abc.ngf")
@@ -100,7 +100,7 @@ def test_functionsByCat_1(PGF):
def test_functionsByCat_2(PGF):
assert PGF.functionsByCat("S") == ["c"]
def test_functionsByCat_non_existant(PGF):
def test_functionsByCat_non_existent(PGF):
assert PGF.functionsByCat("X") == []
def test_categoryContext_1(PGF):
@@ -169,7 +169,7 @@ def test_functionType_2(PGF):
def test_functionType_3(PGF):
assert PGF.functionType("c") == readType("N -> S")
def test_functionType_non_existant(PGF):
def test_functionType_non_existent(PGF):
with pytest.raises(KeyError):
assert PGF.functionType("cbx")