diff options
author | Roland Reichwein <mail@reichwein.it> | 2023-01-01 21:16:19 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2023-01-01 21:16:19 +0100 |
commit | a72cd70af957a06ae870d93314b4ed0f3625f6ee (patch) | |
tree | 9da93fc597d26ac3cec93a4518649871453a7f94 /tests/test-storage.cpp | |
parent | 6c339d8aab380a191fe3fce7ca7dc7c09e252ebd (diff) |
Adjust to Debian 11 build
Diffstat (limited to 'tests/test-storage.cpp')
-rw-r--r-- | tests/test-storage.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test-storage.cpp b/tests/test-storage.cpp index 87168fc..158a9bd 100644 --- a/tests/test-storage.cpp +++ b/tests/test-storage.cpp @@ -184,3 +184,23 @@ TEST_F(StorageTest, getRow) EXPECT_EQ(std::get<2>(row), 456); } +TEST_F(StorageTest, revision_increment) +{ + Storage storage(m_config); + storage.setDocument("0", "xyz"); + storage.setDocument("0bc", "xyz2"); + storage.setDocument("iabc", "xyz3"); + + EXPECT_EQ(storage.getRevision("0"), 0); + EXPECT_EQ(storage.getRevision("0bc"), 0); + EXPECT_EQ(storage.getRevision("iabc"), 0); + + storage.setDocument("0bc", "xyz234"); + EXPECT_EQ(storage.getRevision("0bc"), 1); + + storage.setDocument("0bc", "xyz2345"); + EXPECT_EQ(storage.getRevision("0"), 0); + EXPECT_EQ(storage.getRevision("0bc"), 2); + EXPECT_EQ(storage.getRevision("iabc"), 0); +} + |