1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-22 15:21:52 +03:00

added missing tests

This commit is contained in:
Niels Lohmann
2017-02-26 11:50:52 +01:00
parent f1cd15ce7e
commit d1b30250d6
3 changed files with 17 additions and 1 deletions

View File

@ -63,7 +63,7 @@ TEST_CASE("regression tests")
SECTION("pull request #71 - handle enum type")
{
enum { t = 0, u = 1};
enum { t = 0, u = 102};
json j = json::array();
j.push_back(t);
@ -73,6 +73,9 @@ TEST_CASE("regression tests")
auto anon_enum_value = j2.get<decltype(u)>();
CHECK(u == anon_enum_value);
// check if the actual value was stored
CHECK(j2 == 102);
static_assert(std::is_same<decltype(anon_enum_value), decltype(u)>::value, "");
j.push_back(json::object(