aboutsummaryrefslogtreecommitdiff
path: root/tests/issues/test_issue_6101.odin
blob: 9f24ade5212f52570b11801618bb13ed97c1c067 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)
}