summaryrefslogtreecommitdiff
path: root/test/test-endswith.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-endswith.c')
-rw-r--r--test/test-endswith.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test-endswith.c b/test/test-endswith.c
new file mode 100644
index 0000000..7ad61a7
--- /dev/null
+++ b/test/test-endswith.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include "string_common.h"
+
+int main() {
+ int r, result1, result2;
+ char *foo = "this is a string";
+ char *bar = "string";
+
+ result1 = endswith(foo, bar);
+ result2 = endswith("string", "asdf");
+
+ r = (result1 == 1) && (result2 == 0);
+
+ printf("%s: endswith\n", r ? "PASS" : "FAIL");
+
+ return r;
+}