mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Add some extra tests
The behaviour here is unchanged, but was previously untested.
This commit is contained in:
parent
7fb5b773dd
commit
18869c2c75
@ -272,6 +272,24 @@ namespace
|
|||||||
EXPECT_EQ(variables["load-savegame"].as<boost::filesystem::path>().string(), "");
|
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)
|
TEST(OpenMWOptionsFromConfig, should_throw_on_multiple_load_savegame)
|
||||||
{
|
{
|
||||||
bpo::options_description description = makeOptionsDescription();
|
bpo::options_description description = makeOptionsDescription();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user