forked from github/server
add a very simple tst for unicode comparisons
This commit is contained in:
parent
4f5bd43dcf
commit
5dcbb8a3f4
|
@ -16,9 +16,17 @@ static void test_unicode_tolower(CuTest * tc)
|
||||||
CuAssertStrEquals(tc, "helloX", buffer);
|
CuAssertStrEquals(tc, "helloX", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_unicode_compare(CuTest *tc)
|
||||||
|
{
|
||||||
|
CuAssertIntEquals(tc, 0, unicode_utf8_strcasecmp("ABCDEFG", "abcdefg"));
|
||||||
|
CuAssertIntEquals(tc, 0, unicode_utf8_strcasecmp("abcdefg123", "ABCDEFG123"));
|
||||||
|
CuAssertIntEquals(tc, 1, unicode_utf8_strcasecmp("bacdefg123", "ABCDEFG123"));
|
||||||
|
}
|
||||||
|
|
||||||
CuSuite *get_unicode_suite(void)
|
CuSuite *get_unicode_suite(void)
|
||||||
{
|
{
|
||||||
CuSuite *suite = CuSuiteNew();
|
CuSuite *suite = CuSuiteNew();
|
||||||
SUITE_ADD_TEST(suite, test_unicode_tolower);
|
SUITE_ADD_TEST(suite, test_unicode_tolower);
|
||||||
|
SUITE_ADD_TEST(suite, test_unicode_compare);
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue