add test for enum and ordered_json

This commit is contained in:
Alexey Ochapov 2021-02-05 20:09:38 +03:00
parent 18a5f4c7ca
commit d2852ea0c1
No known key found for this signature in database
GPG Key ID: 9DC52E8F031B8DA8

View File

@ -32,6 +32,7 @@ SOFTWARE.
#define JSON_TESTS_PRIVATE
#include <nlohmann/json.hpp>
using nlohmann::json;
using nlohmann::ordered_json;
#include <deque>
#include <forward_list>
@ -1684,6 +1685,9 @@ TEST_CASE("JSON to enum mapping")
// invalid json -> first enum
CHECK(cards::kreuz == json("what?").get<cards>());
// issue #2491, fixed in #2624
CHECK(ordered_json(cards::kreuz) == "kreuz");
}
SECTION("traditional enum")