aboutsummaryrefslogtreecommitdiffstats
path: root/strcaseeqnul.c
diff options
context:
space:
mode:
Diffstat (limited to 'strcaseeqnul.c')
-rw-r--r--strcaseeqnul.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/strcaseeqnul.c b/strcaseeqnul.c
index a40aaf7..bd900d6 100644
--- a/strcaseeqnul.c
+++ b/strcaseeqnul.c
@@ -12,6 +12,21 @@ extern inline int libsimple_strcaseeqnul(const char *, const char *);
int
main(void)
{
+ assert(libsimple_strcaseeqnul("abc", "abc") == 1);
+ assert(libsimple_strcaseeqnul("abc", "ab") == 0);
+ assert(libsimple_strcaseeqnul("ab", "abc") == 0);
+ assert(libsimple_strcaseeqnul("ab", "xy") == 0);
+ assert(libsimple_strcaseeqnul("xy", "ab") == 0);
+ assert(libsimple_strcaseeqnul("", "1") == 0);
+ assert(libsimple_strcaseeqnul("1", "") == 0);
+ assert(libsimple_strcaseeqnul("", "") == 1);
+ assert(libsimple_strcaseeqnul("abc", "ABC") == 1);
+ assert(libsimple_strcaseeqnul("ABC", "abc") == 1);
+ assert(libsimple_strcaseeqnul("", NULL) == 0);
+ assert(libsimple_strcaseeqnul("1", NULL) == 0);
+ assert(libsimple_strcaseeqnul(NULL, "") == 0);
+ assert(libsimple_strcaseeqnul(NULL, "1") == 0);
+ assert(libsimple_strcaseeqnul(NULL, NULL) == 1);
return 0;
}