Skip to content

Commit

Permalink
[tests] Verify that erase deletes snapshot file
Browse files Browse the repository at this point in the history
  • Loading branch information
ricab committed Nov 23, 2023
1 parent de0bf1a commit 873e8d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_base_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,4 +582,16 @@ TEST_F(TestBaseSnapshot, eraseCallsImpl)
snapshot.erase();
}

TEST_F(TestBaseSnapshot, eraseRemovesJSON)
{
MockBaseSnapshot snapshot{"House of Mojo", "voodoo", nullptr, specs, vm};
snapshot.capture();

const auto expected_filename = derive_persisted_snapshot_filename(snapshot.get_index());
ASSERT_TRUE(QFileInfo{expected_filename}.exists());

snapshot.erase();
EXPECT_FALSE(QFileInfo{expected_filename}.exists());
}

} // namespace

0 comments on commit 873e8d6

Please sign in to comment.