1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-31 10:24:23 +03:00

fixed #89 without breaking #71

This commit is contained in:
Niels
2015-06-15 19:45:25 +02:00
parent 8e9a711996
commit 51edad3962
3 changed files with 77 additions and 14 deletions

View File

@ -8892,4 +8892,13 @@ TEST_CASE("regression tests")
float foo = j["Foo"];
CHECK(foo == Approx(42.42));
}
SECTION("issue #89 - nonstandard integer type")
{
// create JSON class with nonstandard integer number type
nlohmann::basic_json<std::map, std::vector, std::string, bool, int32_t, float> j;
j["int_1"] = 1;
// we need to cast to int to compile with Catch - the value is int32_t
CHECK(static_cast<int>(j["int_1"]) == 1);
}
}