aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/encoding/utf8/east_asian/east_asian_width_test.v
diff options
context:
space:
mode:
Diffstat (limited to 'v_windows/v/vlib/encoding/utf8/east_asian/east_asian_width_test.v')
-rw-r--r--v_windows/v/vlib/encoding/utf8/east_asian/east_asian_width_test.v23
1 files changed, 23 insertions, 0 deletions
diff --git a/v_windows/v/vlib/encoding/utf8/east_asian/east_asian_width_test.v b/v_windows/v/vlib/encoding/utf8/east_asian/east_asian_width_test.v
new file mode 100644
index 0000000..a44a9f8
--- /dev/null
+++ b/v_windows/v/vlib/encoding/utf8/east_asian/east_asian_width_test.v
@@ -0,0 +1,23 @@
+module east_asian
+
+fn test_width() {
+ assert east_asian_width_property_at('A', 0) == .narrow
+ assert east_asian_width_property_at('A', 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
+}