MCPcopy Create free account
hub / github.com/etingof/apacheconfig / testHereDoc

Method testHereDoc

tests/unit/test_parser.py:405–426  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

403 )
404
405 def testHereDoc(self):
406 text = """\
407<main>
408 PYTHON <<MYPYTHON
409 def a():
410 x = y
411 return
412 MYPYTHON
413</main>
414"""
415 ast = self._make_parser().parse(text)
416
417 self.assertEqual(
418 ast, [
419 'contents', ['block', ('main',), [
420 'contents', [
421 'statement', 'PYTHON', ' def a():\n '
422 'x = y\n return'
423 ]
424 ], 'main']
425 ]
426 )
427
428 def testHereDocEscapedNewlinePreservesWhitespace(self):
429 text = """\

Callers

nothing calls this directly

Calls 2

_make_parserMethod · 0.95
parseMethod · 0.45

Tested by

no test coverage detected