mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Enforce a consistent output order when saving a MetadataList
This commit is contained in:
@@ -80,6 +80,10 @@ void MetadataList::Save(const boost::filesystem::path& filepath) const {
|
||||
emitter << YAML::Key << "globals" << YAML::Value << messages_;
|
||||
|
||||
auto plugins = Plugins();
|
||||
plugins.sort([](const PluginMetadata& p1, const PluginMetadata& p2) {
|
||||
return p1.GetLowercasedName() < p2.GetLowercasedName();
|
||||
});
|
||||
|
||||
if (!plugins.empty())
|
||||
emitter << YAML::Key << "plugins" << YAML::Value << plugins;
|
||||
|
||||
|
||||
@@ -74,16 +74,16 @@ protected:
|
||||
std::stringstream expectedContent;
|
||||
expectedContent
|
||||
<< "plugins:" << endl
|
||||
<< " - name: '" << blankEsm << "'" << endl
|
||||
<< " tag:" << endl
|
||||
<< " - Actors.ACBS" << endl
|
||||
<< " - Actors.AIData" << endl
|
||||
<< " - -C.Water" << endl
|
||||
<< " - name: '" << blankDifferentEsm << "'" << endl
|
||||
<< " dirty:" << endl
|
||||
<< " - crc: 0x7d22f9df" << endl
|
||||
<< " util: 'TES4Edit'" << endl
|
||||
<< " udr: 4";
|
||||
<< " udr: 4" << endl
|
||||
<< " - name: '" << blankEsm << "'" << endl
|
||||
<< " tag:" << endl
|
||||
<< " - Actors.ACBS" << endl
|
||||
<< " - Actors.AIData" << endl
|
||||
<< " - -C.Water";
|
||||
|
||||
return expectedContent.str();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user