mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.13] gh-111201: fix auto-indent in pyrepl for muliple pound comments (GH-123196) (GH-123764)
(cherry picked from commit d683f49a7b
)
Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
This commit is contained in:
parent
37e1f8d2a0
commit
b221c5bba1
2 changed files with 19 additions and 1 deletions
|
@ -466,6 +466,24 @@ class TestPyReplAutoindent(TestCase):
|
|||
output = multiline_input(reader)
|
||||
self.assertEqual(output, output_code)
|
||||
|
||||
def test_auto_indent_with_multicomment(self):
|
||||
# fmt: off
|
||||
events = code_to_events(
|
||||
"def f(): ## foo\n"
|
||||
"pass\n\n"
|
||||
)
|
||||
|
||||
output_code = (
|
||||
"def f(): ## foo\n"
|
||||
" pass\n"
|
||||
" "
|
||||
)
|
||||
# fmt: on
|
||||
|
||||
reader = self.prepare_reader(events)
|
||||
output = multiline_input(reader)
|
||||
self.assertEqual(output, output_code)
|
||||
|
||||
def test_auto_indent_ignore_comments(self):
|
||||
# fmt: off
|
||||
events = code_to_events(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue