diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/ECSTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ECSTest.cpp b/src/test/ECSTest.cpp index af2b7b0..8f86a91 100644 --- a/src/test/ECSTest.cpp +++ b/src/test/ECSTest.cpp @@ -466,3 +466,17 @@ TEST_F(ECSTest, ComponentsByTag) { EXPECT_EQ(objects.size(), 3); } } + +TEST_F(ECSTest, Snapshot) { + GameObject foo = mgr.new_object("foo"); + + foo.transform.position = {1, 1}; + + ComponentManager::Snapshot snapshot = mgr.save(); + + foo.transform.position = {0, 0}; + + mgr.restore(snapshot); + + EXPECT_EQ(foo.transform.position, (vec2{1, 1})); +} |