improved test coverage

This commit is contained in:
Niels Lohmann 2017-10-22 08:53:27 +02:00
parent b27a142ec0
commit 24b6e028a9
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
6 changed files with 204 additions and 72 deletions

View file

@ -77,6 +77,7 @@ TEST_CASE("constructors")
auto t = json::value_t::boolean;
json j(t);
CHECK(j.type() == t);
CHECK(j == false);
}
SECTION("string")
@ -84,6 +85,7 @@ TEST_CASE("constructors")
auto t = json::value_t::string;
json j(t);
CHECK(j.type() == t);
CHECK(j == "");
}
SECTION("number_integer")
@ -91,6 +93,7 @@ TEST_CASE("constructors")
auto t = json::value_t::number_integer;
json j(t);
CHECK(j.type() == t);
CHECK(j == 0);
}
SECTION("number_unsigned")
@ -98,6 +101,7 @@ TEST_CASE("constructors")
auto t = json::value_t::number_unsigned;
json j(t);
CHECK(j.type() == t);
CHECK(j == 0);
}
SECTION("number_float")
@ -105,6 +109,7 @@ TEST_CASE("constructors")
auto t = json::value_t::number_float;
json j(t);
CHECK(j.type() == t);
CHECK(j == 0.0);
}
}