Test for toggling IUTF8
This commit is contained in:
parent
29988c94fa
commit
3f272d102b
@ -33,10 +33,14 @@ class Callbacks:
|
|||||||
def buf_toggled(self, is_alt):
|
def buf_toggled(self, is_alt):
|
||||||
self.is_alt = is_alt
|
self.is_alt = is_alt
|
||||||
|
|
||||||
|
def use_utf8(self, on):
|
||||||
|
self.iutf8 = on
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
self.wtcbuf = b''
|
self.wtcbuf = b''
|
||||||
self.iconbuf = self.titlebuf = self.colorbuf = self.qbuf = self.ctbuf = ''
|
self.iconbuf = self.titlebuf = self.colorbuf = self.qbuf = self.ctbuf = ''
|
||||||
self.is_alt = False
|
self.is_alt = False
|
||||||
|
self.iutf8 = True
|
||||||
|
|
||||||
|
|
||||||
def filled_line_buf(ynum=5, xnum=5, cursor=Cursor()):
|
def filled_line_buf(ynum=5, xnum=5, cursor=Cursor()):
|
||||||
|
|||||||
@ -80,7 +80,9 @@ class TestParser(BaseTest):
|
|||||||
pb = partial(self.parse_bytes_dump, s)
|
pb = partial(self.parse_bytes_dump, s)
|
||||||
pb('\033)0\x0e/_', ('screen_designate_charset', 1, ord('0')), ('screen_change_charset', 1), '/_')
|
pb('\033)0\x0e/_', ('screen_designate_charset', 1, ord('0')), ('screen_change_charset', 1), '/_')
|
||||||
self.ae(str(s.line(0)), '/\xa0 ')
|
self.ae(str(s.line(0)), '/\xa0 ')
|
||||||
pb('\033%G_', ('screen_use_latin1', 0), '_')
|
self.assertTrue(s.callbacks.iutf8)
|
||||||
|
pb('\033%@_', ('screen_use_latin1', 1), '_')
|
||||||
|
self.assertFalse(s.callbacks.iutf8)
|
||||||
s = self.create_screen()
|
s = self.create_screen()
|
||||||
pb = partial(self.parse_bytes_dump, s)
|
pb = partial(self.parse_bytes_dump, s)
|
||||||
pb('\033(0/_', ('screen_designate_charset', 0, ord('0')), '/_')
|
pb('\033(0/_', ('screen_designate_charset', 0, ord('0')), '/_')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user