aboutsummaryrefslogtreecommitdiff
path: root/test/test1.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test1.c')
-rw-r--r--test/test1.c32
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");
+}