feat: add ability reading stream_listpacks_2/3 rdb types (#4192)

* feat: add ability reading stream_listpacks_2/3 rdb types

* refactor: address comments
This commit is contained in:
Borys 2024-11-26 16:43:30 +02:00 committed by GitHub
parent f84e1eeac8
commit 3327e1a908
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 89 additions and 4 deletions

View file

@ -655,4 +655,28 @@ TEST_F(RdbTest, SnapshotTooBig) {
ASSERT_THAT(resp, ErrArg("Out of memory"));
}
TEST_F(RdbTest, LoadStream2) {
auto ec = LoadRdb("RDB_TYPE_STREAM_LISTPACKS_2.rdb");
ASSERT_FALSE(ec) << ec.message();
auto res = Run({"XINFO", "STREAM", "mystream"});
EXPECT_THAT(
res.GetVec(),
ElementsAre("length", IntArg(2), "radix-tree-keys", IntArg(1), "radix-tree-nodes", IntArg(2),
"last-generated-id", "1732613360686-0", "max-deleted-entry-id", "0-0",
"entries-added", IntArg(0), "recorded-first-entry-id", "0-0", "groups", IntArg(1),
"first-entry", ArgType(RespExpr::ARRAY), "last-entry", ArgType(RespExpr::ARRAY)));
}
TEST_F(RdbTest, LoadStream3) {
auto ec = LoadRdb("RDB_TYPE_STREAM_LISTPACKS_2.rdb");
ASSERT_FALSE(ec) << ec.message();
auto res = Run({"XINFO", "STREAM", "mystream"});
EXPECT_THAT(
res.GetVec(),
ElementsAre("length", IntArg(2), "radix-tree-keys", IntArg(1), "radix-tree-nodes", IntArg(2),
"last-generated-id", "1732613360686-0", "max-deleted-entry-id", "0-0",
"entries-added", IntArg(0), "recorded-first-entry-id", "0-0", "groups", IntArg(1),
"first-entry", ArgType(RespExpr::ARRAY), "last-entry", ArgType(RespExpr::ARRAY)));
}
} // namespace dfly