mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-106970: Fix Argument Clinic 'destination <name> clear' command (#106972)
Add test for the 'destination <name> clear' command, and the 'destination' directive in general. Fix two bugs in 'destination <name> clear' command: 1. The text attribute of the allocator is called 'text', not '_text' 2. Return after processing the 'clear' command, instead of proceeding directly to the fail().
This commit is contained in:
parent
cdeb1a6caa
commit
3372bcba98
4 changed files with 77 additions and 8 deletions
|
@ -249,6 +249,15 @@ class ClinicWholeFileTest(_ParserBase):
|
|||
out = self.expect_failure(raw)
|
||||
self.assertEqual(out, msg)
|
||||
|
||||
def test_unknown_destination_command(self):
|
||||
out = self.expect_failure("""
|
||||
/*[clinic input]
|
||||
destination buffer nosuchcommand
|
||||
[clinic start generated code]*/
|
||||
""")
|
||||
msg = "unknown destination command 'nosuchcommand'"
|
||||
self.assertIn(msg, out)
|
||||
|
||||
|
||||
class ClinicGroupPermuterTest(TestCase):
|
||||
def _test(self, l, m, r, output):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue