fixed #89 without breaking #71

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

No files matched your search

+9
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);
}
}