threading tests for pending

This commit is contained in:
Kovid Goyal 2023-11-08 12:41:14 +05:30
parent a6da0ac6ca
commit c66c0b8edc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -115,6 +115,18 @@ def test_parser_threading(self):
self.assertFalse(self.write_bytes(s, self.create_write_buffer(s), '23mx'))
self.parse_written_data(s, ('select_graphic_rendition', '23'), 'x')
# now test with pending
for start in range(len('\x1b[?2026h')):
prefix = '\x1b[?2026h'[:start]
suffix = '\x1b[?2026h'[start:]
self.assertFalse(self.write_bytes(s, self.create_write_buffer(s), prefix))
b = self.create_write_buffer(s)
self.parse_written_data(s)
self.assertFalse(self.write_bytes(s, b, suffix + 'mouse' + '\x1b[?2026l'[:start]))
self.parse_written_data(s, ('screen_start_pending_mode',))
self.assertFalse(self.write_bytes(s, self.create_write_buffer(s), '\x1b[?2026l'[start:] + ' cheese'))
self.parse_written_data(s, 'mouse', ('screen_stop_pending_mode',), ' cheese')
def test_base64(self):
for src, expected in {
'bGlnaHQgdw==': 'light w',