summaryrefslogtreecommitdiff
path: root/Tests/LibCore/TestLibCoreArgsParser.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-26 22:32:37 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-26 23:27:57 +0100
commitf1cc3d0fc48af5247278101f863d6416f763733e (patch)
tree56029f2d24e02d6028e6ea45c3037865739527c9 /Tests/LibCore/TestLibCoreArgsParser.cpp
parent395ba619d8b0a5ac38368991a9da445cfb0e03a9 (diff)
downloadserenity-f1cc3d0fc48af5247278101f863d6416f763733e.zip
Userland: Use Core::ArgsParser's Vector<StringView> API everywhere
...and remove the Vector<String> variant since there are no remaining users of this API.
Diffstat (limited to 'Tests/LibCore/TestLibCoreArgsParser.cpp')
-rw-r--r--Tests/LibCore/TestLibCoreArgsParser.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Tests/LibCore/TestLibCoreArgsParser.cpp b/Tests/LibCore/TestLibCoreArgsParser.cpp
index 753dca8958..b19f0fab81 100644
--- a/Tests/LibCore/TestLibCoreArgsParser.cpp
+++ b/Tests/LibCore/TestLibCoreArgsParser.cpp
@@ -147,7 +147,7 @@ TEST_CASE(positional_string_argument)
TEST_CASE(positional_vector_string_argument)
{
// Zero or more positional arguments, zero given
- Vector<String> values = {};
+ Vector<StringView> values;
auto parser_result = run_parser({ "app" }, [&](auto& parser) {
parser.add_positional_argument(values, "values", "values", Core::ArgsParser::Required::No);
});
@@ -213,7 +213,7 @@ TEST_CASE(combination_of_bool_options_with_positional_vector_string)
// Expected: all arguments fill as given
bool bool_opt1 = false;
bool bool_opt2 = false;
- Vector<String> positionals = {};
+ Vector<StringView> positionals;
auto parser_result = run_parser({ "app", "-b", "-c", "one", "two" }, [&](auto& parser) {
parser.add_option(bool_opt1, "bool_opt1", nullptr, 'b');
parser.add_option(bool_opt2, "bool_opt2", nullptr, 'c');
@@ -318,7 +318,7 @@ TEST_CASE(stop_on_first_non_option)
// Expected: bool options are set and one positional argument is filled
bool bool_opt1 = false;
bool bool_opt2 = false;
- Vector<String> positionals = {};
+ Vector<StringView> positionals;
auto parser_result = run_parser({ "app", "-b", "-c", "one" }, [&](auto& parser) {
parser.set_stop_on_first_non_option(false);
parser.add_option(bool_opt1, "bool_opt1", nullptr, 'b');