1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-29 22:11:34 +00:00

Add some extra tests

The behaviour here is unchanged, but was previously untested.
This commit is contained in:
AnyOldName3 2021-10-11 00:02:33 +01:00
parent 7fb5b773dd
commit 18869c2c75

View file

@ -272,6 +272,24 @@ namespace
EXPECT_EQ(variables["load-savegame"].as<boost::filesystem::path>().string(), "");
}
TEST(OpenMWOptionsFromConfig, should_ignore_whitespace_prefixed_commented_option)
{
bpo::options_description description = makeOptionsDescription();
std::istringstream stream(" \t#load-savegame=save.omwsave");
bpo::variables_map variables;
Files::parseConfig(stream, variables, description);
EXPECT_EQ(variables["load-savegame"].as<boost::filesystem::path>().string(), "");
}
TEST(OpenMWOptionsFromConfig, should_support_whitespace_around_option)
{
bpo::options_description description = makeOptionsDescription();
std::istringstream stream(" load-savegame = save.omwsave ");
bpo::variables_map variables;
Files::parseConfig(stream, variables, description);
EXPECT_EQ(variables["load-savegame"].as<boost::filesystem::path>().string(), "save.omwsave");
}
TEST(OpenMWOptionsFromConfig, should_throw_on_multiple_load_savegame)
{
bpo::options_description description = makeOptionsDescription();