fix(config): preserve explicit null when merging objects

This commit is contained in:
Aleksei Bavshin
2021-09-15 22:14:12 +07:00
parent ccc60b4245
commit 0c1d3e30b6
4 changed files with 13 additions and 4 deletions

View File

@ -67,6 +67,8 @@ TEST_CASE("Load simple config with include", "[config]") {
REQUIRE(data["height"].asInt() == 30);
// config override behavior: preserve value from the top config
REQUIRE(data["position"].asString() == "top");
// config override behavior: explicit null is still a value and should be preserved
REQUIRE((data.isMember("nullOption") && data["nullOption"].isNull()));
}
SECTION("select configs for configured output") {
auto configs = conf.getOutputConfigs("HDMI-0", "Fake HDMI output #0");