From 5c9f49e2123c5df7148939a70b80cd72e4e59646 Mon Sep 17 00:00:00 2001 From: Michael Grunder Date: Tue, 19 May 2020 12:56:02 -0700 Subject: Resp3 verbatim string support (#805) Pull RESP3 verbatim string handling from Redis Fixes #802 --- test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test.c') diff --git a/test.c b/test.c index d8b9555..8e45e78 100644 --- a/test.c +++ b/test.c @@ -477,6 +477,17 @@ static void test_reply_reader(void) { ((redisReply*)reply)->elements == 0); freeReplyObject(reply); redisReaderFree(reader); + + /* RESP3 verbatim strings (GitHub issue #802) */ + test("Can parse RESP3 verbatim strings: "); + reader = redisReaderCreate(); + redisReaderFeed(reader,(char*)"=10\r\ntxt:LOLWUT\r\n",17); + ret = redisReaderGetReply(reader,&reply); + test_cond(ret == REDIS_OK && + ((redisReply*)reply)->type == REDIS_REPLY_VERB && + !memcmp(((redisReply*)reply)->str,"LOLWUT", 6)); + freeReplyObject(reply); + redisReaderFree(reader); } static void test_free_null(void) { -- cgit v1.2.3