mirror of
https://github.com/NixOS/nix
synced 2025-06-30 11:43:15 +02:00
Fix -Wdangling-reference
This commit is contained in:
parent
26b33aa1b0
commit
0f723769b7
2 changed files with 14 additions and 12 deletions
|
@ -63,9 +63,7 @@ TEST(valueAt, simpleObject) {
|
|||
|
||||
auto nested = R"({ "hello": { "world": "" } })"_json;
|
||||
|
||||
auto & nestedObject = valueAt(getObject(nested), "hello");
|
||||
|
||||
ASSERT_EQ(valueAt(nestedObject, "world"), "");
|
||||
ASSERT_EQ(valueAt(valueAt(getObject(nested), "hello"), "world"), "");
|
||||
}
|
||||
|
||||
TEST(valueAt, missingKey) {
|
||||
|
@ -83,7 +81,7 @@ TEST(getObject, rightAssertions) {
|
|||
|
||||
auto nested = R"({ "object": { "object": {} } })"_json;
|
||||
|
||||
auto & nestedObject = getObject(valueAt(getObject(nested), "object"));
|
||||
auto nestedObject = getObject(valueAt(getObject(nested), "object"));
|
||||
|
||||
ASSERT_EQ(nestedObject, getObject(nlohmann::json::parse(R"({ "object": {} })")));
|
||||
ASSERT_EQ(getObject(valueAt(getObject(nestedObject), "object")), (nlohmann::json::object_t {}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue