♻️ rename internal_binary_t with binary_t

This commit is contained in:
Niels Lohmann
2020-05-17 22:50:27 +02:00
parent dead99eb0e
commit 904642f261
59 changed files with 536 additions and 457 deletions

View File

@@ -968,21 +968,35 @@ TEST_CASE("modifiers")
SECTION("binary_t type")
{
json j = json::binary_array({1, 2, 3, 4});
json::binary_t s = {1, 2, 3, 4};
json::binary_t s = {{5, 6, 7, 8}};
j.swap(s);
CHECK(j == json::binary_array({1, 2, 3, 4}));
CHECK(j == json::binary_array({5, 6, 7, 8}));
j.swap(s);
CHECK(j == json::binary_array({1, 2, 3, 4}));
}
SECTION("non-string_t type")
SECTION("binary_t::container_type type")
{
json j = json::binary_array({1, 2, 3, 4});
std::vector<std::uint8_t> s = {{5, 6, 7, 8}};
j.swap(s);
CHECK(j == json::binary_array({5, 6, 7, 8}));
j.swap(s);
CHECK(j == json::binary_array({1, 2, 3, 4}));
}
SECTION("non-binary_t type")
{
json j = 17;
json::binary_t s = {1, 2, 3, 4};
json::binary_t s = {{1, 2, 3, 4}};
CHECK_THROWS_AS(j.swap(s), json::type_error&);
CHECK_THROWS_WITH(j.swap(s), "[json.exception.type_error.310] cannot use swap() with number");