From b8feb03975b3d413f01fceb83f233c5263b3a711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20=C3=87etin?= <64282645+egecetin@users.noreply.github.com> Date: Tue, 31 Dec 2024 13:23:32 +0300 Subject: [PATCH] Improve coverage and clarify InputParser behaviour (#365) --- include/utils/InputParser.hpp | 2 +- tests/unittests/Utils_UnitTests.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/utils/InputParser.hpp b/include/utils/InputParser.hpp index 861935915..23bbc1159 100644 --- a/include/utils/InputParser.hpp +++ b/include/utils/InputParser.hpp @@ -44,7 +44,7 @@ class InputParser { } /** - * Gets all command line options + * Gets all command line options. All options should start with '-' * @return std::vector> All command line options */ [[nodiscard]] std::vector> getCmdOptions() const diff --git a/tests/unittests/Utils_UnitTests.cpp b/tests/unittests/Utils_UnitTests.cpp index 12d0454e1..febec44d4 100644 --- a/tests/unittests/Utils_UnitTests.cpp +++ b/tests/unittests/Utils_UnitTests.cpp @@ -112,4 +112,9 @@ TEST(Utils_Tests, InputParserUnitTests) ASSERT_EQ("", parser.getCmdOption("--argument2")); ASSERT_TRUE(parser.cmdOptionExists("--argument2")); + + auto options = parser.getCmdOptions(); + ASSERT_EQ(options.size(), 1); + ASSERT_EQ(options[0].first, "--argument2"); + ASSERT_EQ(options[0].second, ""); }