Skip to content

Commit

Permalink
💚 add test for ordered_map
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Jul 11, 2020
1 parent 3a80823 commit 738c83d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/src/unit-ordered_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 738c83d

Please sign in to comment.