add tests for binary type

This commit is contained in:
Niels Lohmann
2020-05-10 13:23:18 +02:00
parent fff46ea98c
commit 5c42847011
5 changed files with 67 additions and 22 deletions

View File

@@ -892,6 +892,22 @@ TEST_CASE("element access 1")
CHECK(it == j.end());
}
}
SECTION("binary")
{
{
json j = json::binary_array({1, 2, 3});
json::iterator it = j.erase(j.begin(), j.end());
CHECK(j.type() == json::value_t::null);
CHECK(it == j.end());
}
{
json j = json::binary_array({1, 2, 3});
json::const_iterator it = j.erase(j.cbegin(), j.cend());
CHECK(j.type() == json::value_t::null);
CHECK(it == j.end());
}
}
}
SECTION("erase with two invalid iterators")