aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-02-06 14:21:44 +0100
committerantirez <antirez@gmail.com>2014-02-06 14:21:44 +0100
commit33bb9cdecb836ef36009600f9e60d9f2c764b23b (patch)
tree40c50c7f90a6210298c545cc47ae1100245b699f
parent5d114fceb700b8e63bd37f364d89661e6f8e96a7 (diff)
downloadsds-33bb9cdecb836ef36009600f9e60d9f2c764b23b.tar.xz
sdscatrepr() test added.
-rw-r--r--sds.c7
1 files changed, 7 insertions, 0 deletions
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;