diff options
author | Mattias Andrée <maandree@kth.se> | 2018-11-23 23:37:11 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-11-23 23:37:11 +0100 |
commit | ea9beb1d5dceb99797482ae8b580f5fbd7be8128 (patch) | |
tree | 7a4c9faa17f02c36f6cbd3ee24ce15bc62c67e10 /memrelem.c | |
parent | Split out memelem.h from mem.h (diff) | |
download | libsimple-ea9beb1d5dceb99797482ae8b580f5fbd7be8128.tar.gz libsimple-ea9beb1d5dceb99797482ae8b580f5fbd7be8128.tar.bz2 libsimple-ea9beb1d5dceb99797482ae8b580f5fbd7be8128.tar.xz |
Add tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'memrelem.c')
-rw-r--r-- | memrelem.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; } |