Concept validation must be requested
This commit is contained in:
@@ -1225,6 +1225,28 @@ class TestConceptLexerParser(TestUsingMemoryBasedSheerka):
|
||||
OneOrMore(ConceptExpression(baz, rule_name="baz")), rule_name="oc"), rule_name="s")
|
||||
assert parse_res.value.value == expected
|
||||
|
||||
def test_i_concept_validation_is_not_set_when_no_variables(self):
|
||||
foo = Concept(name="foo")
|
||||
grammar = {foo: "foo"}
|
||||
|
||||
context, res, wrapper, return_value = self.execute([foo], grammar, "foo")
|
||||
assert not return_value[0].concept.metadata.need_validation
|
||||
|
||||
def test_i_concept_validation_is_set_when_unnamed_variables_are_found(self):
|
||||
foo = Concept(name="foo")
|
||||
grammar = {foo: Sequence("foo", OrderedChoice("a", "b"))}
|
||||
|
||||
context, res, wrapper, return_value = self.execute([foo], grammar, "foo a")
|
||||
assert not return_value[0].concept.metadata.need_validation
|
||||
|
||||
def test_i_concept_validation_is_set_when_named_variables_are_found(self):
|
||||
foo = Concept(name="foo")
|
||||
grammar = {foo: Sequence("foo", OrderedChoice("a", "b", rule_name="var"))}
|
||||
|
||||
context, res, wrapper, return_value = self.execute([foo], grammar, "foo a")
|
||||
assert return_value[0].concept.metadata.need_validation
|
||||
|
||||
|
||||
#
|
||||
# def test_i_can_parse_basic_arithmetic_operations_and_resolve_properties(self):
|
||||
# context = self.get_context()
|
||||
|
||||
Reference in New Issue
Block a user