From ea9beb1d5dceb99797482ae8b580f5fbd7be8128 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 23 Nov 2018 23:37:11 +0100 Subject: Add tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- memrelem.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'memrelem.c') diff --git a/memrelem.c b/memrelem.c index 8121423..ca45136 100644 --- a/memrelem.c +++ b/memrelem.c @@ -100,6 +100,11 @@ main(void) assert(!libsimple_memrelem("bc123abc123a", 4, "123", 3)); assert(!libsimple_memrelem("abc123abc123", 0, "123", 3)); + assert(!strcmpnul(libsimple_memrelem("-a-aa--a", 4, "a-", 2), "a--a")); + assert(!strcmpnul(libsimple_memrelem("--a--aa----a", 4, "a--", 3), "a----a")); + assert(!strcmpnul(libsimple_memrelem("---a---aa------a", 4, "a---", 4), "a------a")); + assert(!strcmpnul(libsimple_memrelem("-------a-------aa--------------a", 4, "a-------", 8), "a--------------a")); + return 0; } -- cgit v1.2.3-70-g09d2