mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-07 04:34:03 -05:00
Add tests for new c32 hepler functions
This commit is contained in:
parent
8e77228faa
commit
cd23652b39
1 changed files with 22 additions and 0 deletions
22
char32.c
22
char32.c
|
|
@ -53,6 +53,14 @@ UNITTEST
|
||||||
xassert(c32cmp(U"b", U"a") > 0);
|
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
|
UNITTEST
|
||||||
{
|
{
|
||||||
char32_t copy[16];
|
char32_t copy[16];
|
||||||
|
|
@ -127,6 +135,20 @@ UNITTEST
|
||||||
xassert(c32cmp(dst, U"foobar12345678") == 0);
|
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
|
UNITTEST
|
||||||
{
|
{
|
||||||
char32_t *c = xc32dup(U"foobar");
|
char32_t *c = xc32dup(U"foobar");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue