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

Method testCStyleComments

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

Source from the content-addressed store, hash-verified

91 )
92
93 def testCStyleComments(self):
94 text = """\
95/*a*/
96/*
97# b
98*/
99 """
100 ApacheConfigLexer = make_lexer()
101 ApacheConfigParser = make_parser()
102
103 parser = ApacheConfigParser(
104 ApacheConfigLexer(), start='contents')
105
106 ast = parser.parse(text)
107 self.assertEqual(
108 ast, [
109 'contents', ['comment', 'a'],
110 ['comment', '\n# b\n']
111 ]
112 )
113
114 def testCStyleCommentsDisabled(self):
115 text = """\

Callers

nothing calls this directly

Calls 3

make_lexerFunction · 0.90
make_parserFunction · 0.90
parseMethod · 0.45

Tested by

no test coverage detected