diff --git a/docs/metadata/data_structures/plugin.rst b/docs/metadata/data_structures/plugin.rst index 38e07590..e86581de 100644 --- a/docs/metadata/data_structures/plugin.rst +++ b/docs/metadata/data_structures/plugin.rst @@ -93,13 +93,13 @@ This is the structure that brings all the others together, and forms the main co ``cleaning data set`` - Cleaning data for this plugin, identifying dirty plugins. Plugin entries with regular expression filenames **must not** contain cleaning data. + An unordered set of cleaning data structures for this plugin, identifying dirty plugins. .. describe:: clean ``cleaning data set`` - An unordered set of cleaning data structures for this plugin, identifying clean plugins. Plugin entries with regular expression filenames **must not** contain cleaning data. The ``itm``, ``udr`` and ``nav`` fields are unused in this context, as they're assumed to be zero. + An unordered set of cleaning data structures for this plugin, identifying clean plugins. The ``itm``, ``udr`` and ``nav`` fields are unused in this context, as they're assumed to be zero. Equality -------- diff --git a/src/api/metadata/yaml/plugin_metadata.h b/src/api/metadata/yaml/plugin_metadata.h index 6a0ccdf9..9d98745c 100644 --- a/src/api/metadata/yaml/plugin_metadata.h +++ b/src/api/metadata/yaml/plugin_metadata.h @@ -119,24 +119,12 @@ struct convert { if (node["tag"]) rhs.SetTags(node["tag"].as>()); if (node["dirty"]) { - if (rhs.IsRegexPlugin()) - throw RepresentationException(node.Mark(), - "bad conversion: 'dirty' key must not be " - "present in a regex 'plugin metadata' " - "object"); - else - rhs.SetDirtyInfo( - node["dirty"].as>()); + rhs.SetDirtyInfo( + node["dirty"].as>()); } if (node["clean"]) { - if (rhs.IsRegexPlugin()) - throw RepresentationException(node.Mark(), - "bad conversion: 'clean' key must not be " - "present in a regex 'plugin metadata' " - "object"); - else - rhs.SetCleanInfo( - node["clean"].as>()); + rhs.SetCleanInfo( + node["clean"].as>()); } if (node["url"]) rhs.SetLocations(node["url"].as>()); diff --git a/src/tests/api/internals/metadata/plugin_metadata_test.h b/src/tests/api/internals/metadata/plugin_metadata_test.h index 44fb138b..b8530ce3 100644 --- a/src/tests/api/internals/metadata/plugin_metadata_test.h +++ b/src/tests/api/internals/metadata/plugin_metadata_test.h @@ -959,8 +959,12 @@ TEST_P(PluginMetadataTest, " util: 'utility'\n" " udr: 1\n" " nav: 2"); + PluginMetadata plugin = node.as(); - EXPECT_THROW(node.as(), YAML::RepresentationException); + EXPECT_EQ("Blank\\.esp", plugin.GetName()); + EXPECT_EQ(std::set( + {PluginCleaningData(5, "utility", info_, 0, 1, 2)}), + plugin.GetDirtyInfo()); } TEST_P(PluginMetadataTest, @@ -970,8 +974,12 @@ TEST_P(PluginMetadataTest, "clean:\n" " - crc: 0x5\n" " util: 'utility'"); + PluginMetadata plugin = node.as(); - EXPECT_THROW(node.as(), YAML::RepresentationException); + EXPECT_EQ("Blank\\.esp", plugin.GetName()); + EXPECT_EQ(std::set( + {PluginCleaningData(5, "utility")}), + plugin.GetCleanInfo()); } TEST_P(PluginMetadataTest, decodingFromYamlWithAnInvalidRegexNameShouldThrow) {