refactor(config): more sensible multi-bar include behavior

This commit is contained in:
Aleksei Bavshin
2021-09-14 12:16:37 +07:00
parent 8912bd3ed0
commit ccc60b4245
8 changed files with 28 additions and 58 deletions

View File

@ -62,7 +62,8 @@ TEST_CASE("Load simple config with include", "[config]") {
SECTION("validate the config data") {
auto& data = conf.getConfig();
REQUIRE(data["layer"].asString() == "bottom");
// config override behavior: preserve first included value
REQUIRE(data["layer"].asString() == "top");
REQUIRE(data["height"].asInt() == 30);
// config override behavior: preserve value from the top config
REQUIRE(data["position"].asString() == "top");

View File

@ -1,9 +1,4 @@
[
{
"output": "OUT-0",
"height": 20
},
{},
{},
{}
]
{
"output": "OUT-0",
"height": 20
}

View File

@ -1,8 +1,3 @@
[
{},
{
"height": 21
},
{},
{}
]
{
"height": 21
}

View File

@ -1,9 +1,4 @@
[
{},
{},
{
"output": "OUT-1",
"height": 22
},
{}
]
{
"output": "OUT-1",
"height": 22
}

View File

@ -1,8 +1,3 @@
[
{},
{},
{},
{
"height": 23
}
]
{
"height": 23
}

View File

@ -1,9 +1,4 @@
[
{},
{},
{},
{
"output": "OUT-3",
"include": "test/config/include-multi-3-0.json"
}
]
{
"output": "OUT-3",
"include": "test/config/include-multi-3-0.json"
}