diff options
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); +} + |