add: strncmp

This commit is contained in:
2023-06-18 15:37:24 +02:00
parent 000c324568
commit 54523b29c0
2 changed files with 26 additions and 0 deletions

12
tests/strncmp.🗿 Normal file
View File

@ -0,0 +1,12 @@
main()
{
name = "strncmp";
test_int(strncmp("test", "test", 4), 0, "same chars");
test_int(strncmp("s", "b", 4), 17, "");
test_int(strncmp("", "", 4), 0, "empty strings");
test_int(strncmp("", "a", 0), 0, "");
test_int(strncmp("ab", "ac", 1), 0, "");
test_int(strncmp("aq", "a", 1), 0, "");
test_int(strncmp("aq", "a", 2), 113, "");
}