summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pyrepl/test_pyrepl.py
diff options
context:
space:
mode:
authorAya Elsayed <ayah.ehab11@gmail.com>2024-05-22 05:56:35 (GMT)
committerGitHub <noreply@github.com>2024-05-22 05:56:35 (GMT)
commit5091c4400c9ea2a2d1e4d89a28c9d0de2651fa6d (patch)
tree8f69df5fef2bea1a94eaf437bcb3b7c9687a714e /Lib/test/test_pyrepl/test_pyrepl.py
parente6572e8f98d33994d2d0dd3afa92a2a72ee642a9 (diff)
downloadcpython-5091c4400c9ea2a2d1e4d89a28c9d0de2651fa6d.zip
cpython-5091c4400c9ea2a2d1e4d89a28c9d0de2651fa6d.tar.gz
cpython-5091c4400c9ea2a2d1e4d89a28c9d0de2651fa6d.tar.bz2
gh-118911: Trailing whitespace in a block shouldn't prevent the user from terminating the code block (#119355)
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/test/test_pyrepl/test_pyrepl.py')
-rw-r--r--Lib/test/test_pyrepl/test_pyrepl.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py
index 7b5217e..bdcabf9 100644
--- a/Lib/test/test_pyrepl/test_pyrepl.py
+++ b/Lib/test/test_pyrepl/test_pyrepl.py
@@ -405,12 +405,21 @@ class TestPyReplOutput(TestCase):
[
Event(evt="key", data="up", raw=bytearray(b"\x1bOA")),
Event(evt="key", data="up", raw=bytearray(b"\x1bOA")),
- Event(evt="key", data="up", raw=bytearray(b"\x1bOA")),
- Event(evt="key", data="right", raw=bytearray(b"\x1bOC")),
- Event(evt="key", data="backspace", raw=bytearray(b"\x7f")),
+ Event(evt="key", data="left", raw=bytearray(b"\x1bOD")),
+ Event(evt="key", data="left", raw=bytearray(b"\x1bOD")),
+ Event(evt="key", data="left", raw=bytearray(b"\x1bOD")),
+ Event(evt="key", data="backspace", raw=bytearray(b"\x08")),
Event(evt="key", data="g", raw=bytearray(b"g")),
Event(evt="key", data="down", raw=bytearray(b"\x1bOB")),
- Event(evt="key", data="down", raw=bytearray(b"\x1bOB")),
+ Event(evt="key", data="backspace", raw=bytearray(b"\x08")),
+ Event(evt="key", data="delete", raw=bytearray(b"\x7F")),
+ Event(evt="key", data="right", raw=bytearray(b"g")),
+ Event(evt="key", data="backspace", raw=bytearray(b"\x08")),
+ Event(evt="key", data="p", raw=bytearray(b"p")),
+ Event(evt="key", data="a", raw=bytearray(b"a")),
+ Event(evt="key", data="s", raw=bytearray(b"s")),
+ Event(evt="key", data="s", raw=bytearray(b"s")),
+ Event(evt="key", data="\n", raw=bytearray(b"\n")),
Event(evt="key", data="\n", raw=bytearray(b"\n")),
],
)
@@ -419,7 +428,7 @@ class TestPyReplOutput(TestCase):
output = multiline_input(reader)
self.assertEqual(output, "def f():\n ...\n ")
output = multiline_input(reader)
- self.assertEqual(output, "def g():\n ...\n ")
+ self.assertEqual(output, "def g():\n pass\n ")
def test_history_navigation_with_up_arrow(self):
events = itertools.chain(