diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 99dcb95fe..a13799d78 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -14,5 +14,6 @@ add_library(dfly_test_lib test_utils.cc) cxx_link(dfly_test_lib dragonfly_lib gtest_main_ext) cxx_test(redis_parser_test dfly_test_lib LABELS DFLY) +cxx_test(list_family_test dfly_test_lib LABELS DFLY) cxx_test(string_family_test dfly_test_lib LABELS DFLY) cxx_test(memcache_parser_test dfly_test_lib LABELS DFLY) diff --git a/server/list_family_test.cc b/server/list_family_test.cc new file mode 100644 index 000000000..ac370bb0e --- /dev/null +++ b/server/list_family_test.cc @@ -0,0 +1,43 @@ +// Copyright 2021, Roman Gershman. All rights reserved. +// See LICENSE for licensing terms. +// + +#include "server/list_family.h" + +#include + +#include "base/gtest.h" +#include "base/logging.h" +#include "server/command_registry.h" +#include "server/conn_context.h" +#include "server/engine_shard_set.h" +#include "server/string_family.h" +#include "server/test_utils.h" +#include "server/transaction.h" +#include "util/uring/uring_pool.h" + +using namespace testing; +using namespace std; +using namespace util; +using namespace boost; + +namespace dfly { + +class ListFamilyTest : public BaseFamilyTest { + protected: +}; + +const char* kKey1 = "x"; +const char* kKey2 = "b"; + +TEST_F(ListFamilyTest, Basic) { + auto resp = Run({"lpush", kKey1, "1"}); + EXPECT_THAT(resp[0], IntArg(1)); + resp = Run({"lpush", kKey2, "2"}); + ASSERT_THAT(resp[0], IntArg(1)); + resp = Run({"llen", kKey1}); + ASSERT_THAT(resp[0], IntArg(1)); +} + + +} // namespace dfly