summaryrefslogtreecommitdiff
path: root/test/test-endswith.c
diff options
context:
space:
mode:
authordaniel <daniel@planethacker.net>2025-05-06 16:57:32 -0700
committerdaniel <daniel@planethacker.net>2025-05-06 16:57:32 -0700
commit2278df1493e064c197913e49b5d1935942d83448 (patch)
tree42f06ab2f76e2ddf228bafbb03f79621975a4534 /test/test-endswith.c
initial import
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;
+}