MCPcopy Index your code
hub / github.com/python/cpython / test_parse_with_body_prefix

Method test_parse_with_body_prefix

Lib/test/test_clinic.py:160–179  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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 = """

Callers

nothing calls this directly

Calls 7

parseMethod · 0.95
CLanguageClass · 0.90
ClinicClass · 0.90
dedentFunction · 0.90
stripMethod · 0.45
lstripMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected