Skip to content

Commit

Permalink
Improve coverage and clarify InputParser behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
Ege Çetin committed Dec 31, 2024
1 parent 0dc3684 commit f913c59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/utils/InputParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class InputParser {
}

/**
* Gets all command line options
* Gets all command line options. All options should start with '-'
* @return std::vector<std::pair<std::string, std::string>> All command line options
*/
[[nodiscard]] std::vector<std::pair<std::string, std::string>> getCmdOptions() const
Expand Down
5 changes: 5 additions & 0 deletions tests/unittests/Utils_UnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[1].first, "--argument2");
ASSERT_EQ(options[1].second, "");
}

0 comments on commit f913c59

Please sign in to comment.