mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
Implement ZADD
This commit is contained in:
parent
2bdde23e1f
commit
6b869b41a7
7 changed files with 219 additions and 1252 deletions
34
src/server/zset_family_test.cc
Normal file
34
src/server/zset_family_test.cc
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue