MCPcopy Index your code
hub / github.com/python/cpython / test_lookahead

Method test_lookahead

Lib/test/test_peg_generator/test_c_parser.py:186–196  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

184 self.run_test(grammar_source, test_source)
185
186 def test_lookahead(self) -> None:
187 grammar_source = """
188 start: NAME &NAME expr NEWLINE? ENDMARKER
189 expr: NAME | NUMBER
190 """
191 test_source = """
192 valid_cases = ["foo bar"]
193 invalid_cases = ["foo 34"]
194 self.check_input_strings_for_grammar(valid_cases, invalid_cases)
195 """
196 self.run_test(grammar_source, test_source)
197
198 def test_negative_lookahead(self) -> None:
199 grammar_source = """

Callers

nothing calls this directly

Calls 1

run_testMethod · 0.95

Tested by

no test coverage detected