aboutsummaryrefslogtreecommitdiffstats
path: root/strcmpnul.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--strcmpnul.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/strcmpnul.c b/strcmpnul.c
index 0a70610..d3d57fa 100644
--- a/strcmpnul.c
+++ b/strcmpnul.c
@@ -12,6 +12,23 @@ extern inline int libsimple_strcmpnul(const char *, const char *);
int
main(void)
{
+ assert(libsimple_strcmpnul(NULL, NULL) == 0);
+ assert(libsimple_strcmpnul(NULL, "") < 0);
+ assert(libsimple_strcmpnul("", NULL) > 0);
+ assert(libsimple_strcmpnul("", "") == 0);
+ assert(libsimple_strcmpnul(NULL, "x") < 0);
+ assert(libsimple_strcmpnul("x", NULL) > 0);
+ assert(libsimple_strcmpnul("x", "x") == 0);
+ assert(libsimple_strcmpnul("a", "b") < 0);
+ assert(libsimple_strcmpnul("b", "a") > 0);
+ assert(libsimple_strcmpnul("aa", "ab") < 0);
+ assert(libsimple_strcmpnul("ab", "aa") > 0);
+ assert(libsimple_strcmpnul("aa", "aa") == 0);
+ assert(libsimple_strcmpnul("A", "a") < 0);
+ assert(libsimple_strcmpnul("a", "A") > 0);
+ assert(libsimple_strcmpnul("AA", "Aa") < 0);
+ assert(libsimple_strcmpnul("Aa", "AA") > 0);
+ assert(libsimple_strcmpnul("AA", "AA") == 0);
return 0;
}