From 33bb9cdecb836ef36009600f9e60d9f2c764b23b Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 6 Feb 2014 14:21:44 +0100 Subject: sdscatrepr() test added. --- sds.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sds.c b/sds.c index 745b4f2..5cdb152 100644 --- a/sds.c +++ b/sds.c @@ -864,6 +864,13 @@ int main(void) { y = sdsnew("bar"); test_cond("sdscmp(bar,bar)", sdscmp(x,y) < 0) + sdsfree(y); + sdsfree(x); + x = sdsnewlen("\a\n\0foo\r",7); + y = sdscatrepr(sdsempty(),x,sdslen(x)); + test_cond("sdscatrepr(...data...)", + memcmp(y,"\"\\a\\n\\x00foo\\r\"",15) == 0) + { int oldfree; -- cgit v1.2.3-70-g09d2