diff options
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -219,6 +219,17 @@ static void test_reply_reader() { ret = redisReplyReaderGetReply(reader,&reply); test_cond(ret == REDIS_OK && reply == (void*)REDIS_REPLY_STATUS); redisReplyReaderFree(reader); + + test("Works when a single newline (\\r\\n) covers two calls to feed: "); + reader = redisReplyReaderCreate(); + redisReplyReaderSetReplyObjectFunctions(reader,NULL); + redisReplyReaderFeed(reader,(char*)"+OK\r",4); + ret = redisReplyReaderGetReply(reader,&reply); + assert(ret == REDIS_OK && reply == NULL); + redisReplyReaderFeed(reader,(char*)"\n",1); + ret = redisReplyReaderGetReply(reader,&reply); + test_cond(ret == REDIS_OK && reply == (void*)REDIS_REPLY_STATUS); + redisReplyReaderFree(reader); } static void test_throughput() { |