From 685c1cfc686af010bca615beb4383e46a2b5e226 Mon Sep 17 00:00:00 2001 From: lisay-yan Date: Thu, 28 Mar 2024 14:31:47 +0800 Subject: [PATCH 1/3] Update reply.cpp --- src/sw/redis++/reply.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sw/redis++/reply.cpp b/src/sw/redis++/reply.cpp index c2d1c4e..aa192d7 100644 --- a/src/sw/redis++/reply.cpp +++ b/src/sw/redis++/reply.cpp @@ -90,6 +90,10 @@ std::string parse(ParseTag, redisReply &reply) { return std::string(reply.str, reply.len); } +redisReply* parse(ParseTag, redisReply &reply) { + return &reply; +} + long long parse(ParseTag, redisReply &reply) { if (!reply::is_integer(reply)) { throw ParseError("INTEGER", reply); From c217cdcf0a3e66b1f11b1c5f265febf838270165 Mon Sep 17 00:00:00 2001 From: lisay-yan Date: Thu, 28 Mar 2024 14:32:41 +0800 Subject: [PATCH 2/3] Update reply.h --- src/sw/redis++/reply.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sw/redis++/reply.h b/src/sw/redis++/reply.h index e78fe16..d934d06 100644 --- a/src/sw/redis++/reply.h +++ b/src/sw/redis++/reply.h @@ -85,6 +85,8 @@ long long parse(ParseTag, redisReply &reply); double parse(ParseTag, redisReply &reply); +redisReply* parse(ParseTag, redisReply &reply); + bool parse(ParseTag, redisReply &reply); template From dec56b75e152caf7c8ab4369b16d17693bb64bbd Mon Sep 17 00:00:00 2001 From: lisay-yan Date: Thu, 28 Mar 2024 14:35:28 +0800 Subject: [PATCH 3/3] Update async_test.h --- test/src/sw/redis++/async_test.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/src/sw/redis++/async_test.h b/test/src/sw/redis++/async_test.h index 2932a9f..5fff696 100644 --- a/test/src/sw/redis++/async_test.h +++ b/test/src/sw/redis++/async_test.h @@ -328,6 +328,19 @@ void AsyncTest::_test_generic() { _redis.template command("del", key); + val = "rawReply"; + args = {"set", key, val}; + auto raw_resp =_redis.template command(args.begin(), args.end()).get(); + REDIS_ASSERT(raw_resp->type == REDIS_REPLY_STATUS, "unexpected return type"); + + args = {"get", key}; + raw_resp =_redis.template command(args.begin(), args.end()).get(); + REDIS_ASSERT(raw_resp->type == REDIS_REPLY_STRING, "unexpected return type"); + + args = {"del", key}; + raw_resp =_redis.template command(args.begin(), args.end()).get(); + REDIS_ASSERT(raw_resp->type == REDIS_REPLY_INTEGER, "unexpected return type"); + std::unordered_set mems = {"a", "b", "c"}; args = {"sadd", another_key}; args.insert(args.end(), mems.begin(), mems.end());