mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 22:45:35 +00:00
Add a test for three way merges
This commit is contained in:
parent
4eac137109
commit
974b4739fa
1 changed files with 26 additions and 0 deletions
|
@ -833,4 +833,30 @@ namespace
|
|||
EXPECT_THAT(dialogue->mInfo, ElementsAre(HasIdEqualTo("info0"), HasIdEqualTo("info2"), HasIdEqualTo("info1")));
|
||||
EXPECT_EQ(std::next(dialogue->mInfo.begin())->mActor, "newActor");
|
||||
}
|
||||
|
||||
TEST(MWWorldStoreTest, shouldPreservePositionWhenPrevIsTheSame)
|
||||
{
|
||||
const DialogueData data = generateDialogueWithInfos(3);
|
||||
|
||||
MWWorld::ESMStore esmStore;
|
||||
loadEsmStore(0, saveDialogueWithInfos(data.mDialogue, data.mInfos), esmStore);
|
||||
|
||||
ESM::DialInfo newInfo = data.mInfos[0];
|
||||
newInfo.mPrev = data.mInfos[2].mId;
|
||||
newInfo.mNext = {};
|
||||
|
||||
loadEsmStore(1, saveDialogueWithInfos(data.mDialogue, std::array{ newInfo }), esmStore);
|
||||
|
||||
newInfo = data.mInfos[1];
|
||||
newInfo.mResponse = "test";
|
||||
|
||||
loadEsmStore(2, saveDialogueWithInfos(data.mDialogue, std::array{ newInfo }), esmStore);
|
||||
|
||||
esmStore.setUp();
|
||||
|
||||
const ESM::Dialogue* dialogue = esmStore.get<ESM::Dialogue>().search(ESM::RefId::stringRefId("dialogue"));
|
||||
ASSERT_NE(dialogue, nullptr);
|
||||
EXPECT_THAT(dialogue->mInfo, ElementsAre(HasIdEqualTo("info1"), HasIdEqualTo("info2"), HasIdEqualTo("info0")));
|
||||
EXPECT_EQ(dialogue->mInfo.begin()->mResponse, "test");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue