mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix(config): preserve explicit null when merging objects
This commit is contained in:
@ -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");
|
||||
|
@ -2,5 +2,6 @@
|
||||
"layer": "top",
|
||||
"position": "bottom",
|
||||
"height": 30,
|
||||
"output": ["HDMI-0", "DP-0"]
|
||||
"output": ["HDMI-0", "DP-0"],
|
||||
"nullOption": "not null"
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"include": ["test/config/include-1.json", "test/config/include-2.json"],
|
||||
"position": "top"
|
||||
"position": "top",
|
||||
"nullOption": null
|
||||
}
|
||||
|
Reference in New Issue
Block a user