From 257a9d40a9a8e7fdfe5325945d2ef10fa2fc6362 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 24 Nov 2010 15:46:05 +0100 Subject: Set error on unexpected nesting of multi bulks --- test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test.c') diff --git a/test.c b/test.c index beccd60..a6527f6 100644 --- a/test.c +++ b/test.c @@ -256,6 +256,17 @@ static void test_reply_reader() { strcasecmp(err,"Protocol error, got \"@\" as reply type byte") == 0); redisReplyReaderFree(reader); + test("Set error on nested multi bulks with depth > 1: "); + reader = redisReplyReaderCreate(); + redisReplyReaderFeed(reader,(char*)"*1\r\n",4); + redisReplyReaderFeed(reader,(char*)"*1\r\n",4); + redisReplyReaderFeed(reader,(char*)"*1\r\n",4); + ret = redisReplyReaderGetReply(reader,NULL); + err = redisReplyReaderGetError(reader); + test_cond(ret == REDIS_ERR && + strncasecmp(err,"No support for",14) == 0); + redisReplyReaderFree(reader); + test("Works with NULL functions for reply: "); reader = redisReplyReaderCreate(); redisReplyReaderSetReplyObjectFunctions(reader,NULL); -- cgit v1.2.3