pocketpy/tests/83_unicodedata.py
2025-05-06 19:23:24 +08:00

18 lines
409 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from unicodedata import east_asian_width
# full width
assert east_asian_width("") == "F"
# half width
assert east_asian_width("") == "H"
# narrow
assert east_asian_width("a") == "Na"
# wide
assert east_asian_width("") == "W"
assert east_asian_width("🥕") == "W"
assert east_asian_width("") == "W"
# ambiguous
assert east_asian_width("°") == "A"
# neutral
assert east_asian_width("\n") == "N"