Fixed #48 : RelationalExpressionParser: Implement relational operator parser
Fixed #49 : ExpressionParser: Implement ExpressionParser Fixed #50 : Implement ReteConditionExprVisitor Fixed #51 : Implement PythonConditionExprVisitor Fixed #52 : SheerkaConceptManager: I can get and set concept property
This commit is contained in:
@@ -95,10 +95,13 @@ class TestExpressionParser(TestUsingMemoryBasedSheerka):
|
||||
@pytest.mark.parametrize("expression, expected", [
|
||||
("ret.status in ('a', 1 , func())", "new_var in ('a', 1 , func())"),
|
||||
("ret.status not in ('a', 1 , func())", "new_var not in ('a', 1 , func())"),
|
||||
("ret.status == 10", "new_var == 10"),
|
||||
("ret.status == 'a'", "new_var == 'a'"),
|
||||
|
||||
])
|
||||
def test_i_can_rebuild_source(self, expression, expected):
|
||||
sheerka, context, parser, parser_input, error_sink = self.init_parser_with_source(expression)
|
||||
parsed = parser.parse_input(context, parser_input, error_sink)
|
||||
|
||||
assert ComparisonNode.rebuild_source("new_var", parsed.comp, parsed.right.get_source()) == expected
|
||||
new_source = ComparisonNode.rebuild_source("new_var", parsed.comp, parsed.right.get_source())
|
||||
assert new_source == expected
|
||||
|
||||
Reference in New Issue
Block a user