gh-124927: Fix conversion issue between coordinates and position in REPL (#125001)

This commit is contained in:
FeH2 2025-03-11 05:54:49 +08:00 committed by GitHub
parent a931a8b324
commit 6ab5c4aa05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View file

@ -319,3 +319,11 @@ class TestReader(TestCase):
# Simulate a resize to 0 columns
reader.screeninfo = []
self.assertEqual(reader.pos2xy(), (0, 0))
def test_setpos_from_xy_for_non_printing_char(self):
code = "# non \u200c printing character"
events = code_to_events(code)
reader, _ = handle_all_events(events)
reader.setpos_from_xy(8, 0)
self.assertEqual(reader.pos, 7)