diff options
author | Taylor C. Richberger <Taywee@gmx.com> | 2017-10-16 13:36:52 -0600 |
---|---|---|
committer | Taylor C. Richberger <Taywee@gmx.com> | 2017-10-16 13:36:52 -0600 |
commit | defbe36b65a708aa9f8d164946509d3d924b2f72 (patch) | |
tree | 27ffe5874aba470f18ca2c81639a8d566091159b /test.cxx | |
parent | Merge pull request #35 from pavel-belikov/implicit-values (diff) | |
download | args.hxx-defbe36b65a708aa9f8d164946509d3d924b2f72.tar.xz |
add a few test cases and bump version6.2.0
Diffstat (limited to 'test.cxx')
-rw-r--r-- | test.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -622,6 +622,11 @@ TEST_CASE("Implicit values work as expected", "[args]") REQUIRE_NOTHROW(parser.ParseArgs(std::vector<std::string>{"-j", "-f"})); REQUIRE(args::get(j) == 0); + REQUIRE(foo); + + REQUIRE_NOTHROW(parser.ParseArgs(std::vector<std::string>{"-f"})); + REQUIRE(args::get(j) == 1); + REQUIRE_FALSE(j); } TEST_CASE("Nargs work as expected", "[args]") @@ -658,6 +663,8 @@ TEST_CASE("Nargs work as expected", "[args]") } REQUIRE((vec == std::vector<int>{1, 2, 3})); + vec.assign(std::begin(b), std::end(b)); + REQUIRE((vec == std::vector<int>{1, 2, 3})); parser.SetArgumentSeparations(true, true, false, false); REQUIRE_THROWS_AS(parser.ParseArgs(std::vector<std::string>{"-a", "1", "2"}), args::ParseError); |