summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test.c')
-rw-r--r--test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test.c b/test.c
index c1065ff..77e7f1a 100644
--- a/test.c
+++ b/test.c
@@ -684,6 +684,16 @@ static void test_reply_reader(void) {
freeReplyObject(reply);
redisReaderFree(reader);
+ test("Correctly parses RESP3 double -Nan: ");
+ reader = redisReaderCreate();
+ redisReaderFeed(reader, ",-nan\r\n", 7);
+ ret = redisReaderGetReply(reader, &reply);
+ test_cond(ret == REDIS_OK &&
+ ((redisReply*)reply)->type == REDIS_REPLY_DOUBLE &&
+ isnan(((redisReply*)reply)->dval));
+ freeReplyObject(reply);
+ redisReaderFree(reader);
+
test("Can parse RESP3 nil: ");
reader = redisReaderCreate();
redisReaderFeed(reader, "_\r\n",3);