diff options
author | 2023-02-03 18:40:59 +0100 | |
---|---|---|
committer | 2023-02-03 18:40:59 +0100 | |
commit | 51c05fe7b5d6518bfb8a07ee3ec3c072bb21163e (patch) | |
tree | 92a52dc4849fbeb2566f8e87a88ff3ec02e5f75e /test/test1.c | |
download | string2-51c05fe7b5d6518bfb8a07ee3ec3c072bb21163e.tar.gz string2-51c05fe7b5d6518bfb8a07ee3ec3c072bb21163e.zip |
Initial commit
Diffstat (limited to 'test/test1.c')
-rw-r--r-- | test/test1.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test1.c b/test/test1.c new file mode 100644 index 0000000..777aa5f --- /dev/null +++ b/test/test1.c @@ -0,0 +1,32 @@ +/* See LICENSE file for copyright and license details. */ + +#include <string2.h> +#include <stdio.h> + +#include "test.h" + +void +test1(void) +{ + printf("executing test1... "); + asserti(0, strends("alexander", "xander")); + asserti(1, strends("alexander", "dander")); + asserti(1, strends("alexander", "alex")); + asserti(0, strends("alexander", "alexander")); + asserti(1, strends("dwm", "dwmdwm")); + + printf("OK\n"); +} + +void +test2(void) +{ + printf("executing test2... "); + asserti(0, strstarts("alexander", "alex")); + asserti(1, strstarts("alexander", "dalex")); + asserti(1, strstarts("alexander", "xander")); + asserti(0, strstarts("alexander", "alexander")); + asserti(1, strstarts("dwm", "dwmdwm")); + + printf("OK\n"); +} |