[ion/utf8_helper] Fix StringGlyphLength

This commit is contained in:
Léa Saviot
2019-06-14 13:50:30 +02:00
committed by EmilieNumworks
parent 2061c5d692
commit 872de8deef
2 changed files with 8 additions and 4 deletions

View File

@@ -10,5 +10,6 @@ QUIZ_CASE(ion_utf8_helper_glyph_length) {
assert_string_glyph_length_is("1ᴇ3", -1, 3);
assert_string_glyph_length_is("∑∫𝐢", -1, 3);
assert_string_glyph_length_is("123", 2, 2);
assert_string_glyph_length_is("1ᴇ3", 2, 1);
uint8_t testString[] = {'a', 'b', 'c', 0b11111111, 0b11111111, 0}; // Malformed utf-8 string
assert_string_glyph_length_is((const char *)testString, 3, 3);
}