[ion/kandinsky] Move unicode to ion

This commit is contained in:
Léa Saviot
2019-01-23 11:00:33 +01:00
committed by Émilie Feral
parent 6b6d3d7fe2
commit bbb10f1993
72 changed files with 241 additions and 226 deletions

15
ion/test/utf8_decoder.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include <quiz.h>
#include <ion/unicode/utf8_decoder.h>
void assert_decodes_to(const char * string, CodePoint c) {
UTF8Decoder d(string);
quiz_assert(d.nextCodePoint() == c);
quiz_assert(d.nextCodePoint() == 0);
}
QUIZ_CASE(ion_utf8_decoder) {
assert_decodes_to("\x20", 0x20);
assert_decodes_to("\xC2\xA2", 0xA2);
assert_decodes_to("\xED\x9F\xBF", 0xD7FF);
assert_decodes_to("\xCC\x81", 0x301);
}