Skip to content

Commit 873e8d6

Browse files
committed
[tests] Verify that erase deletes snapshot file
1 parent de0bf1a commit 873e8d6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_base_snapshot.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -582,4 +582,16 @@ TEST_F(TestBaseSnapshot, eraseCallsImpl)
582582
snapshot.erase();
583583
}
584584

585+
TEST_F(TestBaseSnapshot, eraseRemovesJSON)
586+
{
587+
MockBaseSnapshot snapshot{"House of Mojo", "voodoo", nullptr, specs, vm};
588+
snapshot.capture();
589+
590+
const auto expected_filename = derive_persisted_snapshot_filename(snapshot.get_index());
591+
ASSERT_TRUE(QFileInfo{expected_filename}.exists());
592+
593+
snapshot.erase();
594+
EXPECT_FALSE(QFileInfo{expected_filename}.exists());
595+
}
596+
585597
} // namespace

0 commit comments

Comments
 (0)