diff options
author | Arnon Yaari <wiggin15@yahoo.com> | 2024-09-06 07:33:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 07:33:40 (GMT) |
commit | d683f49a7b0635a26150cfbb398a3d93b227a74e (patch) | |
tree | 053b00ac18ec291c35899ae9cbf13ec40c21124f /Lib/test/test_pyrepl/test_pyrepl.py | |
parent | 67957ea77da8c667df1508a9d3d9b39e59f671d6 (diff) | |
download | cpython-d683f49a7b0635a26150cfbb398a3d93b227a74e.zip cpython-d683f49a7b0635a26150cfbb398a3d93b227a74e.tar.gz cpython-d683f49a7b0635a26150cfbb398a3d93b227a74e.tar.bz2 |
gh-111201: fix auto-indent in pyrepl for muliple pound comments (#123196)
Diffstat (limited to 'Lib/test/test_pyrepl/test_pyrepl.py')
-rw-r--r-- | Lib/test/test_pyrepl/test_pyrepl.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index 012ce7c..d9d83c4 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -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( |