diff options
author | Larry Hastings <larry@hastings.org> | 2014-01-07 20:21:08 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-01-07 20:21:08 (GMT) |
commit | 9026113fd4acbb2fb77a900ae7bd921eebcc29c4 (patch) | |
tree | cc529474ed8aeed9d1e89f23b131be7e8ea94d16 /Tools/clinic/clinic_test.py | |
parent | 77561cccb277f5347fc1c41a2fb06b7cc3194b8a (diff) | |
download | cpython-9026113fd4acbb2fb77a900ae7bd921eebcc29c4.zip cpython-9026113fd4acbb2fb77a900ae7bd921eebcc29c4.tar.gz cpython-9026113fd4acbb2fb77a900ae7bd921eebcc29c4.tar.bz2 |
Issue #20157: When Argument Clinic renames a parameter because its name
collides with a C keyword, it no longer exposes that rename to PyArg_Parse.
Diffstat (limited to 'Tools/clinic/clinic_test.py')
-rw-r--r-- | Tools/clinic/clinic_test.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Tools/clinic/clinic_test.py b/Tools/clinic/clinic_test.py index aeb60a2..e6c5c6c 100644 --- a/Tools/clinic/clinic_test.py +++ b/Tools/clinic/clinic_test.py @@ -54,6 +54,25 @@ class FakeClinic: _module_and_class = clinic.Clinic._module_and_class +class ClinicWholeFileTest(TestCase): + def test_eol(self): + # regression test: + # clinic's block parser didn't recognize + # the "end line" for the block if it + # didn't end in "\n" (as in, the last) + # byte of the file was '/'. + # so it woudl spit out an end line for you. + # and since you really already had one, + # the last line of the block got corrupted. + c = clinic.Clinic(clinic.CLanguage()) + raw = "/*[clinic]\nfoo\n[clinic]*/" + cooked = c.parse(raw).splitlines() + end_line = cooked[2].rstrip() + # this test is redundant, it's just here explicitly to catch + # the regression test so we don't forget what it looked like + self.assertNotEqual(end_line, "[clinic]*/[clinic]*/") + self.assertEqual(end_line, "[clinic]*/") + class ClinicGroupPermuterTest(TestCase): |