Skip to content

Commit

Permalink
Fix the utf8casecmp bug with ascii.
Browse files Browse the repository at this point in the history
Fixes #60.
  • Loading branch information
sheredom committed Dec 24, 2019
1 parent 2a7c5bf commit 6414d20
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 62 deletions.
11 changes: 11 additions & 0 deletions test/main.c
Expand Up @@ -1037,4 +1037,15 @@ UTEST(utf8upr, latin_upper) {
free(str);
}

UTEST(utf8casecmp, basic_ascii) {
ASSERT_EQ(-15, utf8casecmp(".gdoc", ".GSHeeT"));
ASSERT_EQ(-4, utf8casecmp(".gsheet", ".gSLiDe"));

#ifndef _MSC_VER
ASSERT_EQ(strcasecmp(".gdoc", ".GSHeeT"), utf8casecmp(".gdoc", ".GSHeeT"));
ASSERT_EQ(strcasecmp(".gsheet", ".gSLiDe"),
utf8casecmp(".gsheet", ".gSLiDe"));
#endif
}

UTEST_MAIN();

0 comments on commit 6414d20

Please sign in to comment.