1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/encoding/utf8/east_asian/east_asian_width_test.v

24 lines
942 B
V
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.

module east_asian
fn test_width() {
assert east_asian_width_property_at('A', 0) == .narrow
assert east_asian_width_property_at('', 0) == .full
assert east_asian_width_property_at('', 0) == .half
assert east_asian_width_property_at('', 0) == .wide
assert east_asian_width_property_at('', 0) == .ambiguous
assert east_asian_width_property_at('ج', 0) == .neutral
assert display_width('abc', 1) == 3
assert display_width('', 1) == 8
assert display_width('', 1) == 8
assert display_width('', 1) == 4
assert display_width('', 1) == 4
assert display_width('', 1) == 4
assert display_width('', 1) == 4
assert display_width('', 1) == 6
assert display_width('', 1) == 6
assert display_width(' िि', 1) == 9
assert display_width('', 1) == 1
assert display_width('', 2) == 2
assert display_width('🐈👽📛', 1) == 6
}