From 760de7c8115f0e069d905266b7fe4dce34fec290 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 3 Jan 2021 21:29:02 +0200 Subject: [PATCH] ci: use more reliable asserts for test_utf8_wide_char --- vlib/builtin/utf8_test.v | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/vlib/builtin/utf8_test.v b/vlib/builtin/utf8_test.v index d5190fd3f7..ab45e70eea 100644 --- a/vlib/builtin/utf8_test.v +++ b/vlib/builtin/utf8_test.v @@ -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' } }