add tests for binary type

This commit is contained in:
Niels Lohmann
2020-05-09 14:16:57 +02:00
parent b036ace235
commit 34430994bf
2 changed files with 33 additions and 0 deletions

View File

@@ -1461,6 +1461,20 @@ TEST_CASE("constructors")
CHECK(j == j_new);
}
}
SECTION("binary")
{
{
json j = json::binary_array({1, 2, 3});
json j_new(j.begin(), j.end());
CHECK((j == j_new));
}
{
json j = json::binary_array({1, 2, 3});
json j_new(j.cbegin(), j.cend());
CHECK((j == j_new));
}
}
}
SECTION("construct with two invalid iterators")