aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCJ <cjting1128@gmail.com>2026-01-24 01:26:36 +0900
committerCJ <cjting1128@gmail.com>2026-01-24 01:26:36 +0900
commit89f6f535db7cf540aa40f76256b2c180195bf99c (patch)
treea173abe873d9f34f28c58b77ceca9e6a7e62d517 /tests
parentce71227b6bba4bbe74d53c681264a9cba974403a (diff)
Fix string16 bugs in Mac and Linux
Diffstat (limited to 'tests')
-rw-r--r--tests/issues/test_issue_6101.odin23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/issues/test_issue_6101.odin b/tests/issues/test_issue_6101.odin
new file mode 100644
index 000000000..9f24ade52
--- /dev/null
+++ b/tests/issues/test_issue_6101.odin
@@ -0,0 +1,23 @@
+// Tests issue #6101 https://github.com/odin-lang/Odin/issues/6101
+package test_issues
+
+import "core:testing"
+
+@(test)
+test_issue_6101_bmp :: proc(t: ^testing.T) {
+ s := string16("\u732b")
+ testing.expect_value(t, len(s), 1)
+
+ u := transmute([]u16)s
+ testing.expect_value(t, u[0], 0x732b)
+}
+
+@(test)
+test_issue_6101_non_bmp :: proc(t: ^testing.T) {
+ s := string16("\U0001F63A")
+ testing.expect_value(t, len(s), 2)
+
+ u := transmute([]u16)s
+ testing.expect_value(t, u[0], 0xD83D)
+ testing.expect_value(t, u[1], 0xDE3A)
+}