diff options
| author | daniel <daniel@planethacker.net> | 2025-05-06 16:57:32 -0700 |
|---|---|---|
| committer | daniel <daniel@planethacker.net> | 2025-05-06 16:57:32 -0700 |
| commit | 2278df1493e064c197913e49b5d1935942d83448 (patch) | |
| tree | 42f06ab2f76e2ddf228bafbb03f79621975a4534 /test/test-endswith.c | |
initial import
Diffstat (limited to 'test/test-endswith.c')
| -rw-r--r-- | test/test-endswith.c | 17 |
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; +} |
