mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
char32: add helper functions to work with c32 case
This commit is contained in:
parent
19466a21d8
commit
71de0c45bc
2 changed files with 37 additions and 0 deletions
22
char32.c
22
char32.c
|
|
@ -53,6 +53,14 @@ UNITTEST
|
|||
xassert(c32cmp(U"b", U"a") > 0);
|
||||
}
|
||||
|
||||
UNITTEST
|
||||
{
|
||||
xassert(c32ncmp(U"foo", U"foot", 3) == 0);
|
||||
xassert(c32ncmp(U"foot", U"FOOT", 4) > 0);
|
||||
xassert(c32ncmp(U"a", U"b", 1) < 0);
|
||||
xassert(c32ncmp(U"bb", U"aa", 2) > 0);
|
||||
}
|
||||
|
||||
UNITTEST
|
||||
{
|
||||
char32_t copy[16];
|
||||
|
|
@ -127,6 +135,20 @@ UNITTEST
|
|||
xassert(c32cmp(dst, U"foobar12345678") == 0);
|
||||
}
|
||||
|
||||
UNITTEST
|
||||
{
|
||||
xassert(!isc32upper(U'a'));
|
||||
xassert(isc32upper(U'A'));
|
||||
xassert(!isc32upper(U'a'));
|
||||
}
|
||||
|
||||
UNITTEST
|
||||
{
|
||||
xassert(hasc32upper(U"abc1A"));
|
||||
xassert(!hasc32upper(U"abc1_aaa"));
|
||||
xassert(!hasc32upper(U""));
|
||||
}
|
||||
|
||||
UNITTEST
|
||||
{
|
||||
char32_t *c = xc32dup(U"foobar");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue