Moved test for #3007 to proper file.

This commit is contained in:
Anthony Van Herrewege 2021-09-09 15:46:42 +02:00
parent 42b77b5c92
commit 21e645d772
2 changed files with 16 additions and 17 deletions

View File

@ -184,4 +184,20 @@ TEST_CASE("Better diagnostics")
j["second"] = value;
j2["something"] = j;
}
SECTION("Regression test for issue #3007 - Parent pointers properly set when using update()")
{
json j = json::object();
{
json j2 = json::object();
j2["one"] = 1;
j.update(j2);
}
for (auto const & kv : j) {
CHECK(kv.m_parent == &j);
}
}
}

View File

@ -679,23 +679,6 @@ TEST_CASE("regression tests 2")
test3[json::json_pointer(p)] = json::object();
CHECK(test3.dump() == "{\"/root\":{}}");
}
SECTION("issue #3007 - Parent pointers properly set when using update()")
{
json j = json::object();
json lower = json::object();
{
json j2 = json::object();
j2["one"] = 1;
j.update(j2);
}
for (auto const & kv : j) {
CHECK(kv.m_parent == &j);
}
}
}
DOCTEST_CLANG_SUPPRESS_WARNING_POP