aboutsummaryrefslogtreecommitdiff
path: root/source/tests/app/wandac
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-05-17 17:58:38 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-05-17 17:58:38 +0200
commit577fc0845718ed8ad5bebf02a277c0579a817f77 (patch)
tree3d1cdc53c426a0ba60a7996619a7b787850bb3b3 /source/tests/app/wandac
parentde5bf7ca3b7a2bf6be35b86486b00dc6a071b950 (diff)
downloadwanda-577fc0845718ed8ad5bebf02a277c0579a817f77.tar.xz
wanda-577fc0845718ed8ad5bebf02a277c0579a817f77.zip
wanda: restructure source layoutHEADdevelop
Diffstat (limited to 'source/tests/app/wandac')
-rw-r--r--source/tests/app/wandac/CMakeLists.txt11
-rw-r--r--source/tests/app/wandac/src/cli.cpp80
2 files changed, 0 insertions, 91 deletions
diff --git a/source/tests/app/wandac/CMakeLists.txt b/source/tests/app/wandac/CMakeLists.txt
deleted file mode 100644
index ab07030..0000000
--- a/source/tests/app/wandac/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-add_executable("wanda-tests-wandac"
- "src/cli.cpp"
-)
-
-target_link_libraries("wanda-tests-wandac" PRIVATE
- "${PROJECT_NAME}c-components"
-
- "Catch2::Catch2WithMain"
-)
-
-catch_discover_tests("wanda-tests-wandac") \ No newline at end of file
diff --git a/source/tests/app/wandac/src/cli.cpp b/source/tests/app/wandac/src/cli.cpp
deleted file mode 100644
index ed02b4a..0000000
--- a/source/tests/app/wandac/src/cli.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "wandac/cli.hpp"
-
-#include <catch2/catch_all.hpp>
-#include <catch2/catch_test_macros.hpp>
-#include <lyra/args.hpp>
-
-#include <sstream>
-#include <string>
-
-using namespace std::string_literals;
-
-namespace wanda::tests::app::wandac
-{
-
- template<typename ...Ts>
- auto make_argument_list(Ts const & ... args) -> lyra::args
- {
- return {"wanda"s, static_cast<std::string>(args)...};
- }
-
- SCENARIO("Empty argument list parsing", "[app][client][cli]")
- {
- GIVEN("A fresh cli instance and error stream")
- {
- auto cli = ::wandac::cli{};
- auto error_stream = std::ostringstream{};
-
- WHEN("invoking parse without any program arguments")
- {
- auto result = cli.parse(make_argument_list(), error_stream);
-
- THEN("the return value is false") { REQUIRE_FALSE(result); }
- THEN("the error stream is not empty") { REQUIRE_FALSE(error_stream.view().empty()); }
- THEN("the help flag is not set") { REQUIRE_FALSE(cli.help); }
- THEN("the command is empty") { REQUIRE(cli.command.empty()); }
- }
- }
- }
-
- SCENARIO("Valid argument list parsing", "[app][client][cli]")
- {
- GIVEN("A fresh cli instance and error stream")
- {
- auto cli = ::wandac::cli{};
- auto error_stream = std::ostringstream{};
-
- AND_GIVEN("'-h' in the argument list")
- {
- auto argument_list = make_argument_list("-h");
-
- WHEN("invoking parse without additional arguments")
- {
- auto result = cli.parse(argument_list, error_stream);
-
- THEN("the return value is true") { REQUIRE(result); }
- THEN("the error stream is empty") { REQUIRE(error_stream.view().empty()); }
- THEN("the help flag is set") { REQUIRE(cli.help); }
- THEN("the command is empty") { REQUIRE(cli.command.empty()); }
- }
- }
-
- AND_GIVEN("'change' in the argument list")
- {
- auto argument_list = make_argument_list("change");
-
- WHEN("invoking parse without additional arguments")
- {
- auto result = cli.parse(argument_list, error_stream);
-
- THEN("the return valis is true") { REQUIRE(result); }
- THEN("the error stream is empty") { REQUIRE(error_stream.view().empty()); }
- THEN("the help flag is not set") { REQUIRE_FALSE(cli.help); }
- THEN("the command is not empty") { REQUIRE_FALSE(cli.command.empty()); }
- THEN("the command is 'change'") { REQUIRE(cli.command == "change"); }
- }
- }
- }
- }
-
-} // namespace wanda::tests::app::wandac