diff options
author | Pavel Belikov <pavel.fuchs.belikov@gmail.com> | 2017-12-12 20:46:40 +0300 |
---|---|---|
committer | Pavel Belikov <pavel.fuchs.belikov@gmail.com> | 2017-12-12 20:46:40 +0300 |
commit | 1b2f44572bdb93015f12d98ee4447996ab8d28e5 (patch) | |
tree | c93c196a6d4eff377df9c64b5112f74cbea990db /test.cxx | |
parent | Merge pull request #51 from pavel-belikov/fix-usage-wrapping (diff) | |
download | args.hxx-1b2f44572bdb93015f12d98ee4447996ab8d28e5.tar.xz |
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 |