From d2852ea0c1228826ba5a2b3070630312b24f2280 Mon Sep 17 00:00:00 2001 From: Alexey Ochapov Date: Fri, 5 Feb 2021 20:09:38 +0300 Subject: [PATCH] add test for enum and ordered_json --- test/src/unit-conversions.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/src/unit-conversions.cpp b/test/src/unit-conversions.cpp index 4a544ea3f..e9480fd29 100644 --- a/test/src/unit-conversions.cpp +++ b/test/src/unit-conversions.cpp @@ -32,6 +32,7 @@ SOFTWARE. #define JSON_TESTS_PRIVATE #include using nlohmann::json; +using nlohmann::ordered_json; #include #include @@ -1684,6 +1685,9 @@ TEST_CASE("JSON to enum mapping") // invalid json -> first enum CHECK(cards::kreuz == json("what?").get()); + + // issue #2491, fixed in #2624 + CHECK(ordered_json(cards::kreuz) == "kreuz"); } SECTION("traditional enum")