mirror of
https://github.com/jarro2783/cxxopts.git
synced 2026-09-03 03:13:38 +02:00
Fix passing a const array to parse (#258)
Fixes #257. The input array is not modified, so we can declare this as `char const* const*`.
This commit is contained in:
@@ -773,3 +773,9 @@ TEST_CASE("Option add with add_option(string, Option)", "[options]") {
|
||||
CHECK(result["aggregate"].as<int>() == 4);
|
||||
CHECK(result["test"].as<int>() == 5);
|
||||
}
|
||||
|
||||
TEST_CASE("Const array", "[const]") {
|
||||
const char* const option_list[] = {"empty", "options"};
|
||||
cxxopts::Options options("Empty options", " - test constness");
|
||||
auto result = options.parse(2, option_list);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user