Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jarro2783/cxxopts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJarryd Beck <jarro.2783@gmail.com>2017-11-07 09:47:39 +0300
committerJarryd Beck <jarro.2783@gmail.com>2017-11-13 00:10:22 +0300
commitd74a2c65a54f14c632637bb577dce1aeadcaf9e3 (patch)
tree934a884249d8f8fa9e36cdf8b6547fd718ec1aa9 /test
parentf0406578bde4a942556a5f09168b9662287926af (diff)
Add ability to iterate through parsed options
Fixes #74.
Diffstat (limited to 'test')
-rw-r--r--test/options.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/options.cpp b/test/options.cpp
index ed39a10..3533f6e 100644
--- a/test/options.cpp
+++ b/test/options.cpp
@@ -82,6 +82,16 @@ TEST_CASE("Basic options", "[options]")
CHECK(result.count("6") == 1);
CHECK(result.count("p") == 2);
CHECK(result.count("space") == 2);
+
+ auto& arguments = result.arguments();
+ REQUIRE(arguments.size() == 7);
+ CHECK(arguments[0].key() == "long");
+ CHECK(arguments[0].value() == "");
+ CHECK(arguments[0].as<bool>() == true);
+
+ CHECK(arguments[1].key() == "short");
+ CHECK(arguments[2].key() == "value");
+ CHECK(arguments[3].key() == "av");
}
TEST_CASE("Short options", "[options]")