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

ci: use more reliable asserts for test_utf8_wide_char

This commit is contained in:
Delyan Angelov 2021-01-03 21:29:02 +02:00
parent d86304b7d0
commit 760de7c811
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -7,8 +7,19 @@ fn test_utf8_char_len() {
fn test_utf8_wide_char() {
r := ``
val := r.str().str
s := ''
println('r: $r')
println('s: $s')
assert utf8_char_len(r) == 1
assert utf8_char_len(s[0]) == 3
rstr := r.str()
println('rstr: $rstr')
assert s == rstr
//
val := rstr.str
unsafe {
assert '${val[0]:x}${val[1]:x}${val[2]:x}${val[3]:x}' == 'e29c940'
assert val[0].hex() == 'e2'
assert val[1].hex() == '9c'
assert val[2].hex() == '94'
}
}