(self)
| 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 = """\ |
nothing calls this directly
no test coverage detected