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 --- rawmemelem.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'rawmemelem.c') diff --git a/rawmemelem.c b/rawmemelem.c index ba21a32..d2d743a 100644 --- a/rawmemelem.c +++ b/rawmemelem.c @@ -62,6 +62,11 @@ main(void) assert(!strcmpnul(libsimple_rawmemelem("abcd1234abcd1234", "1234", 4), "1234abcd1234")); assert(!strcmpnul(libsimple_rawmemelem("abcdefgh12345678abcdefgh12345678", "12345678", 8), "12345678abcdefgh12345678")); assert(!strcmpnul(libsimple_rawmemelem("abc123abc123", "123", 3), "123abc123")); + + assert(!strcmpnul(libsimple_rawmemelem("-a-aa--a", "a-", 2), "a--a")); + assert(!strcmpnul(libsimple_rawmemelem("--a--aa----a", "a--", 3), "a----a")); + assert(!strcmpnul(libsimple_rawmemelem("---a---aa------a", "a---", 4), "a------a")); + assert(!strcmpnul(libsimple_rawmemelem("-------a-------aa--------------a", "a-------", 8), "a--------------a")); return 0; } -- cgit v1.2.3-70-g09d2