Fixed minor issues and enhancements

This commit is contained in:
2020-05-15 17:01:26 +02:00
parent b54882f994
commit 56e0a9d338
8 changed files with 59 additions and 13 deletions
+19 -1
View File
@@ -776,7 +776,7 @@ class TestSyaNodeParser(TestUsingMemoryBasedSheerka):
("(one infix two) (three prefixed)", ["one", "two", "infix", "three", "prefixed"]),
])
def test_i_can_post_fix_sequences(self, expression, expected):
sheerka, context, parser = self.init_parser(cmap, None)
sheerka, context, parser = self.init_parser()
res = parser.infix_to_postfix(context, expression)
expected_array = compute_expected_array(cmap, expression, expected)
@@ -784,6 +784,24 @@ class TestSyaNodeParser(TestUsingMemoryBasedSheerka):
assert len(res) == 1
assert res[0].out == expected_array
@pytest.mark.parametrize("expression", [
"one ? two : three",
"one?two:three",
"one ?two:three",
"one? two:three",
"one ? two :three",
"one ? two: three",
])
def test_whitespaces_may_be_omitted_in_some_circumstances(self, expression):
sheerka, context, parser = self.init_parser()
expected = ["one", "two", "three", "?"]
res = parser.infix_to_postfix(context, expression)
expected_array = compute_expected_array(cmap, expression, expected)
assert len(res) == 1
assert res[0].out == expected_array
def test_the_more_concepts_the_more_results(self):
concepts_map = {
"plus": Concept("a plus b").def_var("a").def_var("b"),