Update unit-custom-integer.cpp
This commit is contained in:
parent
17f5b3f4c2
commit
3d0c1ba3ee
@ -94,11 +94,11 @@ template<typename T> class std::numeric_limits<wrapped_int<T>>
|
|||||||
|
|
||||||
TEST_CASE("custom integer types")
|
TEST_CASE("custom integer types")
|
||||||
{
|
{
|
||||||
using json = nlohmann::basic_json <
|
using my_json = nlohmann::basic_json <
|
||||||
std::map, std::vector, std::string, bool,
|
std::map, std::vector, std::string, bool,
|
||||||
wrapped_int<std::int64_t>, wrapped_int<std::uint64_t>, double, std::allocator >;
|
wrapped_int<std::int64_t>, wrapped_int<std::uint64_t>, double, std::allocator >;
|
||||||
std::string data = "[1,2,-3,-4]";
|
std::string data = "[1,2,-3,-4]";
|
||||||
json as_json = json::parse(data.begin(), data.end());
|
my_json as_json = my_json::parse(data.begin(), data.end());
|
||||||
wrapped_int<std::uint64_t> i1 = as_json[1];
|
wrapped_int<std::uint64_t> i1 = as_json[1];
|
||||||
wrapped_int<std::int64_t> i2 = as_json[2];
|
wrapped_int<std::int64_t> i2 = as_json[2];
|
||||||
CHECK(i1 == wrapped_int<std::uint64_t>(2));
|
CHECK(i1 == wrapped_int<std::uint64_t>(2));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user