Skip to content

Commit

Permalink
Fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bblanchon committed Apr 12, 2021
1 parent 5258b2c commit 5d3bddd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions extras/tests/JsonVariant/as.cpp
Expand Up @@ -76,11 +76,28 @@ TEST_CASE("JsonVariant::as()") {
REQUIRE(variant.as<std::string>() == "-42");
}

SECTION("set(42UL)") {
variant.set(42UL);

REQUIRE(variant.as<bool>() == true);
REQUIRE(variant.as<double>() == 42.0);
REQUIRE(variant.as<std::string>() == "42");
}

SECTION("set(0L)") {
variant.set(0L);

REQUIRE(variant.as<bool>() == false);
REQUIRE(variant.as<double>() == 0.0);
REQUIRE(variant.as<std::string>() == "0");
}

SECTION("set(0UL)") {
variant.set(0UL);

REQUIRE(variant.as<bool>() == false);
REQUIRE(variant.as<double>() == 0.0);
REQUIRE(variant.as<std::string>() == "0");
}

SECTION("set(null)") {
Expand Down

0 comments on commit 5d3bddd

Please sign in to comment.