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

Method testContentsWhitespace

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

Source from the content-addressed store, hash-verified

52 self.assertEqual(ast, ['statement', 'a', 'b c'])
53
54 def testContentsWhitespace(self):
55 ApacheConfigLexer = make_lexer()
56 ApacheConfigParser = make_parser()
57
58 parser = ApacheConfigParser(ApacheConfigLexer(), start='contents')
59
60 tests = ['a b', 'a b\n', '\n a b', '\n a b \n', '\n a \\\n b \n']
61 for test in tests:
62 ast = parser.parse(test)
63 self.assertEqual(ast, ['contents', ['statement', 'a', 'b']])
64
65 def testHashComments(self):
66 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