| 158 | self.expect_failure(raw, err, filename="test.c", lineno=2) |
| 159 | |
| 160 | def test_parse_with_body_prefix(self): |
| 161 | clang = CLanguage(None) |
| 162 | clang.body_prefix = "//" |
| 163 | clang.start_line = "//[{dsl_name} start]" |
| 164 | clang.stop_line = "//[{dsl_name} stop]" |
| 165 | cl = Clinic(clang, filename="test.c", limited_capi=False) |
| 166 | raw = dedent(""" |
| 167 | //[clinic start] |
| 168 | //module test |
| 169 | //[clinic stop] |
| 170 | """).strip() |
| 171 | out = cl.parse(raw) |
| 172 | expected = dedent(""" |
| 173 | //[clinic start] |
| 174 | //module test |
| 175 | // |
| 176 | //[clinic stop] |
| 177 | /*[clinic end generated code: output=da39a3ee5e6b4b0d input=65fab8adff58cf08]*/ |
| 178 | """).lstrip() # Note, lstrip() because of the newline |
| 179 | self.assertEqual(out, expected) |
| 180 | |
| 181 | def test_cpp_monitor_fail_nested_block_comment(self): |
| 182 | raw = """ |