From 738c83d6af9f482dccb8a5b021d84750828875ec Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 11 Jul 2020 19:24:32 +0200 Subject: [PATCH] :green_heart: add test for ordered_map --- test/src/unit-ordered_json.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/src/unit-ordered_json.cpp b/test/src/unit-ordered_json.cpp index e4ffd68a..2918e442 100644 --- a/test/src/unit-ordered_json.cpp +++ b/test/src/unit-ordered_json.cpp @@ -59,6 +59,13 @@ TEST_CASE("ordered_json") CHECK(j.dump() == "{\"element2\":2,\"element3\":3}"); CHECK(oj.dump() == "{\"element3\":3,\"element2\":2}"); + // remove again and nothing changes + j.erase("element1"); + oj.erase("element1"); + + CHECK(j.dump() == "{\"element2\":2,\"element3\":3}"); + CHECK(oj.dump() == "{\"element3\":3,\"element2\":2}"); + // There are no dup keys cause constructor calls emplace... json multi {{"z", 1}, {"m", 2}, {"m", 3}, {"y", 4}, {"m", 5}}; CHECK(multi.size() == 3);