Home | History | Annotate | Download | only in match

Lines Matching refs:assertion

26   def __init__(self, assertion, lineNo, variables):
27 self.assertion = assertion
37 for assertion in assertions:
38 if (assertion.variant == lastVariant and
39 assertion.variant in [TestAssertion.Variant.DAG, TestAssertion.Variant.Not]):
40 splitAssertions[-1].append(assertion)
42 splitAssertions.append([assertion])
43 lastVariant = assertion.variant
46 def findMatchingLine(assertion, c1Pass, scope, variables, excludeLines=[]):
47 """ Finds the first line in `c1Pass` which matches `assertion`.
52 Returns the index of the `c1Pass` line matching the assertion and variables
59 newVariables = MatchLines(assertion, c1Pass.body[i], variables)
62 raise MatchFailedException(assertion, scope.start, variables)
68 lines in `scope` are scanned and each line can only match one assertion.
71 line numbers) and the variable values after the match of the last assertion.
73 Raises MatchFailedException when an assertion cannot be satisfied.
76 for assertion in assertions:
77 assert assertion.variant == TestAssertion.Variant.DAG
78 match = findMatchingLine(assertion, c1Pass, scope, variables, matchedLines)
89 Raises MatchFailedException if an assertion matches a line in the scope.
93 for assertion in assertions:
94 assert assertion.variant == TestAssertion.Variant.Not
95 if MatchLines(assertion, line, variables) is not None:
96 raise MatchFailedException(assertion, i, variables)
99 for assertion in assertions:
100 if not EvaluateLine(assertion, variables):
101 raise MatchFailedException(assertion, scope.start, variables)
106 Raises MatchFailedException when an assertion cannot be satisfied.
118 # We also add None as an EOF assertion that will set scope for NOTs.
132 # Single in-order assertion. Find the first line that matches.
137 # Single next-line assertion. Test if the current line matches.
184 if e.assertion.variant == TestAssertion.Variant.Not:
185 msg = "NOT assertion matched line {}"
187 msg = "Assertion could not be matched starting from line {}"
189 Logger.testFailed(msg, e.assertion, e.variables)