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

Method testOptionAndValue

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

Source from the content-addressed store, hash-verified

34 self.assertEqual(ast, ['statement', 'a', '三'])
35
36 def testOptionAndValue(self):
37 ApacheConfigLexer = make_lexer()
38 ApacheConfigParser = make_parser()
39
40 parser = ApacheConfigParser(ApacheConfigLexer(), start='statement')
41
42 ast = parser.parse('a')
43 self.assertEqual(ast, ['statement', 'a'])
44
45 ast = parser.parse('a b')
46 self.assertEqual(ast, ['statement', 'a', 'b'])
47
48 ast = parser.parse('a=b')
49 self.assertEqual(ast, ['statement', 'a', 'b'])
50
51 ast = parser.parse('a "b c"')
52 self.assertEqual(ast, ['statement', 'a', 'b c'])
53
54 def testContentsWhitespace(self):
55 ApacheConfigLexer = make_lexer()

Callers

nothing calls this directly

Calls 3

make_lexerFunction · 0.90
make_parserFunction · 0.90
parseMethod · 0.45

Tested by

no test coverage detected