diff --git a/test/options.cpp b/test/options.cpp index 503ed39..794486c 100644 --- a/test/options.cpp +++ b/test/options.cpp @@ -423,6 +423,9 @@ TEST_CASE("Booleans", "[boolean]") { ("bool", "A Boolean", cxxopts::value()) ("debug", "Debugging", cxxopts::value()) ("timing", "Timing", cxxopts::value()) + ("noExplicitDefault", "No Explicit Default", cxxopts::value()) + ("defaultTrue", "Timing", cxxopts::value()->default_value("true")) + ("defaultFalse", "Timing", cxxopts::value()->default_value("false")) ("others", "Other arguments", cxxopts::value>()) ; @@ -438,10 +441,16 @@ TEST_CASE("Booleans", "[boolean]") { REQUIRE(result.count("bool") == 1); REQUIRE(result.count("debug") == 1); REQUIRE(result.count("timing") == 1); + REQUIRE(result.count("noExplicitDefault") == 1); + REQUIRE(result.count("defaultTrue") == 1); + REQUIRE(result.count("defaultFalse") == 1); CHECK(result["bool"].as() == false); CHECK(result["debug"].as() == true); CHECK(result["timing"].as() == true); + CHECK(result["noExplicitDefault"].as() == false); + CHECK(result["defaultTrue"].as() == true); + CHECK(result["defaultFalse"].as() == false); REQUIRE(result.count("others") == 1); }