Make wcswidth useable in a streaming fashion

This commit is contained in:
Kovid Goyal
2020-09-21 13:31:24 +05:30
parent b5007ba276
commit 444080f320
6 changed files with 162 additions and 113 deletions

View File

@@ -357,6 +357,7 @@ class TestDataTypes(BaseTest):
self.ae(wcswidth('a\033[2mb'), 2)
self.ae(wcswidth('\033a\033[2mb'), 2)
self.ae(wcswidth('a\033]8;id=moo;https://foo\033\\a'), 2)
self.ae(wcswidth('a\033x'), 2)
self.ae(tuple(map(w, 'a1\0コニチ ✔')), (1, 1, 0, 2, 2, 2, 1, 1))
self.ae(wcswidth('\u2716\u2716\ufe0f\U0001f337'), 5)
self.ae(wcswidth('\u25b6\ufe0f'), 2)