fix space leak in PySequence_AsHypos. PyList_FromHypos->PyTuple_FromHypos

This commit is contained in:
krangelov
2021-10-16 21:12:16 +02:00
parent 0eb6e9f724
commit 0e98c30973
5 changed files with 28 additions and 40 deletions

View File

@@ -104,10 +104,10 @@ def test_functionsByCat_non_existent(PGF):
assert PGF.functionsByCat("X") == []
def test_categoryContext_1(PGF):
assert PGF.categoryContext("N") == []
assert PGF.categoryContext("N") == ()
def test_categoryContext_2(PGF):
assert PGF.categoryContext("S") == []
assert PGF.categoryContext("S") == ()
def test_categoryContext_3(PGF):
cxt = PGF.categoryContext("P")

View File

@@ -89,7 +89,8 @@ def test_extended_categories(gr2):
assert gr2.categories == ["Float","Int","N","P","Q","S","String"]
def test_extended_category_context(gr2):
assert gr2.categoryContext("Q") == [(BIND_TYPE_EXPLICIT, "x", ty)]
print(gr2.categoryContext("Q"))
assert gr2.categoryContext("Q") == ((BIND_TYPE_EXPLICIT, "x", ty),)
def test_extended_function_type(gr2):
assert gr2.functionType("foo") == ty
@@ -112,7 +113,7 @@ def test_branched_categories(gr3):
assert gr3.categories == ["Float","Int","N","P","R","S","String"]
def test_branched_category_context(gr3):
assert gr3.categoryContext("R") == [(BIND_TYPE_EXPLICIT, "x", ty)]
assert gr3.categoryContext("R") == ((BIND_TYPE_EXPLICIT, "x", ty),)
def test_branched_function_type(gr3):
assert gr3.functionType("bar") == ty