diff --git a/src/sw/redis++/reply.cpp b/src/sw/redis++/reply.cpp index c2d1c4ef..aa192d73 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); diff --git a/src/sw/redis++/reply.h b/src/sw/redis++/reply.h index e78fe164..d934d062 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 diff --git a/test/src/sw/redis++/async_test.h b/test/src/sw/redis++/async_test.h index 2932a9fe..5fff696d 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());