argparse/test
Zhihao Yuan 8201a18568
Fix various issues in Argument constructor
Before this change:

1. When the input is built-in string literal or cv-`char*`,
   `is_optional` constructs temporary `std::string` while
   `mNames` initializer is also constructing `std::string`
   due to the use of `std::initializer_list`.
2. When the input is `std::string_view`, doesn't compile.
3. When the input is `std::string`, `mNames` initializer
   moves `args`.  If argument name is longer than
   `std::string`'s SSO buffer, bad thing will happen because
   `is_optional` will be accessing `args` in moved-from
   states.

Because of the use of `strtol` which expects nul-terminated
input, `is_*` series functions must take `std::string`.  This
restriction may be removed after AppleClang adds `<charconv>`.
But for now, it complicates the patch.  My solution is to
create an array prvalue still, but use a array reference
rather than `std::initializer_list` to refer to it, so that
the code in delegated constructor can keep using fold
expressions after the necessary `std::string` objects being
created.
2019-11-17 01:51:36 -06:00
..
.gitignore
catch.hpp
CMakeLists.txt
main.cpp Give ArgumentParser value semantics 2019-11-16 15:15:54 -06:00
README.md
test_actions.hpp Bind extra arguments to actions 2019-11-14 01:30:04 -06:00
test_compound_arguments.hpp
test_container_arguments.hpp
test_help.hpp
test_invalid_arguments.hpp
test_issue_37.hpp Added test case for issue #37 2019-11-13 08:25:07 -06:00
test_negative_numbers.hpp
test_optional_arguments.hpp Fix various issues in Argument constructor 2019-11-17 01:51:36 -06:00
test_parent_parsers.hpp Stop sharing argument values with parent parsers 2019-11-16 14:33:00 -06:00
test_parse_args.hpp
test_positional_arguments.hpp
test_required_arguments.hpp
test_utility.hpp
test_value_semantics.hpp Give ArgumentParser value semantics 2019-11-16 15:15:54 -06:00

Argparse Tests

Linux

$ mkdir build
$ cd build
$ cmake ../.
$ make
$ ./tests

Windows

  1. Generate Visual Studio solution
$ mkdir build
$ cd build
$ cmake ../. -G "Visual Studio 15 2017"
  1. Open ARGPARSE.sln
  2. Build tests in RELEASE | x64
  3. Run tests.exe