diff options
author | Taylor C. Richberger <taywee@gmx.com> | 2017-12-12 13:55:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-12 13:55:52 -0700 |
commit | 4ac0840b657a8e4e74ea6742f8cab7e24acd771c (patch) | |
tree | c93c196a6d4eff377df9c64b5112f74cbea990db /test.cxx | |
parent | Merge pull request #51 from pavel-belikov/fix-usage-wrapping (diff) | |
parent | add more GetChoicesString overrides (diff) | |
download | args.hxx-4ac0840b657a8e4e74ea6742f8cab7e24acd771c.tar.xz |
Merge pull request #53 from pavel-belikov/map-flag-list-choices
Add more GetChoicesString overrides
Diffstat (limited to 'test.cxx')
-rw-r--r-- | test.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1227,6 +1227,20 @@ TEST_CASE("Default values work as expected", "[args]") )"); } +TEST_CASE("Choices description works as expected", "[args]") +{ + args::ArgumentParser p("parser"); + args::MapFlag<int, int> map(p, "map", "map", {"map"}, {{1,1}, {2, 2}}); + args::MapFlagList<char, int> maplist(p, "maplist", "maplist", {"maplist"}, {{'1',1}, {'2', 2}}); + args::MapPositional<std::string, int, args::ValueReader, std::map> mappos(p, "mappos", "mappos", {{"1",1}, {"2", 2}}); + args::MapPositionalList<char, int, std::vector, args::ValueReader, std::map> mapposlist(p, "mapposlist", "mapposlist", {{'1',1}, {'2', 2}}); + + REQUIRE(map.HelpChoices(p.helpParams) == "1, 2"); + REQUIRE(maplist.HelpChoices(p.helpParams) == "1, 2"); + REQUIRE(mappos.HelpChoices(p.helpParams) == "1, 2"); + REQUIRE(mapposlist.HelpChoices(p.helpParams) == "1, 2"); +} + #undef ARGS_HXX #define ARGS_TESTNAMESPACE #define ARGS_NOEXCEPT |