Implement ZADD

This commit is contained in:
Roman Gershman 2022-03-05 23:42:35 +02:00
parent 2bdde23e1f
commit 6b869b41a7
7 changed files with 219 additions and 1252 deletions

View file

@ -0,0 +1,34 @@
// Copyright 2022, Roman Gershman. All rights reserved.
// See LICENSE for licensing terms.
//
#include "server/zset_family.h"
#include "base/gtest.h"
#include "base/logging.h"
#include "facade/facade_test.h"
#include "server/command_registry.h"
#include "server/test_utils.h"
using namespace testing;
using namespace std;
using namespace util;
using namespace boost;
namespace dfly {
class ZSetFamilyTest : public BaseFamilyTest {
protected:
};
TEST_F(ZSetFamilyTest, Add) {
auto resp = Run({"zadd", "x", "1.1", "a"});
EXPECT_THAT(resp[0], IntArg(1));
resp = Run({"zadd", "x", "2", "a"});
EXPECT_THAT(resp[0], IntArg(0));
resp = Run({"zadd", "x", "ch", "3", "a"});
EXPECT_THAT(resp[0], IntArg(1));
}
} // namespace dfly