Skip to content

Commit 7e265fa

Browse files
committed
revise test with removed ZWJ guards
1 parent 6a60d4d commit 7e265fa

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

tests/test_emojis.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,20 +219,13 @@ def test_regional_indicator_four():
219219

220220
@pytest.mark.skipif(NARROW_ONLY, reason="Test cannot verify on python 'narrow' builds")
221221
def test_zwj_after_non_emoji():
222-
"""ZWJ after non-emoji text should not consume following character."""
223-
assert wcwidth.wcswidth('xx\u200d\U0001F384') == 4
224-
225-
226-
@pytest.mark.skipif(NARROW_ONLY, reason="Test cannot verify on python 'narrow' builds")
227-
def test_zwj_after_narrow_char():
228-
"""ZWJ after narrow character should not consume following character."""
229-
assert wcwidth.wcswidth('a\u200d\U0001F600') == 3
230-
231-
232-
@pytest.mark.skipif(NARROW_ONLY, reason="Test cannot verify on python 'narrow' builds")
233-
def test_zwj_after_cjk():
234-
"""ZWJ after CJK wide character should not consume following character."""
235-
assert wcwidth.wcswidth('\u4e16\u200d\U0001F600') == 4
222+
"""ZWJ after non-emoji unconditionally consumes next character."""
223+
# This does *not* match most terminal behavior -- it is a negative test,
224+
# they fail because our library doesn't handle 'glitch' emoji as an
225+
# optimization. Non-emoji + ZWJ is undefined per Unicode UAX #29 GB11.
226+
assert wcwidth.wcswidth('xx\u200d\U0001F384') == 2
227+
assert wcwidth.wcswidth('a\u200d\U0001F600') == 1
228+
assert wcwidth.wcswidth('\u4e16\u200d\U0001F600') == 2
236229

237230

238231
@pytest.mark.skipif(NARROW_ONLY, reason="Test cannot verify on python 'narrow' builds")

0 commit comments

Comments
 (0)