mirror of
https://github.com/Textualize/rich.git
synced 2026-02-06 10:58:48 +00:00
fix test
This commit is contained in:
parent
454fcfc92c
commit
31930ddc84
@ -150,7 +150,9 @@ def _cell_len(text: str, unicode_version: str) -> int:
|
||||
while index < character_count:
|
||||
character = text[index]
|
||||
if character in SPECIAL:
|
||||
if character == "\ufe0f" and last_measured_character:
|
||||
if character == "\u200d":
|
||||
index += 1
|
||||
elif character == "\ufe0f" and last_measured_character:
|
||||
total_width += last_measured_character in cell_table.narrow_to_wide
|
||||
last_measured_character = None
|
||||
else:
|
||||
|
||||
@ -194,7 +194,9 @@ def test_zwj():
|
||||
assert cell_len("") == 0
|
||||
assert cell_len("\u200d") == 0
|
||||
assert cell_len("1\u200d") == 1
|
||||
assert cell_len("1\u200d2") == 2
|
||||
# This sequence should really produce 2, but it aligns with with wcwidth
|
||||
# What gets written to the terminal is anybody's guess, I've seen multiple variations
|
||||
assert cell_len("1\u200d2") == 1
|
||||
|
||||
|
||||
def test_non_printable():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user