aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.cli/test_command_map.cc
diff options
context:
space:
mode:
Diffstat (limited to 'nihil.cli/test_command_map.cc')
-rw-r--r--nihil.cli/test_command_map.cc32
1 files changed, 0 insertions, 32 deletions
diff --git a/nihil.cli/test_command_map.cc b/nihil.cli/test_command_map.cc
deleted file mode 100644
index 1b87a49..0000000
--- a/nihil.cli/test_command_map.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This source code is released into the public domain.
- */
-
-#include <vector>
-
-#include <catch2/catch_test_macros.hpp>
-
-import nihil.cli;
-
-namespace {
-
-auto cmd_sub1_called = false;
-auto cmd_sub1 = nihil::command("cmd sub1", "", [](int, char **) -> int
-{
- cmd_sub1_called = true;
- return 0;
-});
-
-} // anonymous namespace
-
-TEST_CASE("command_map: basic", "[command_map]")
-{
- auto args = std::vector<char const *>{
- "cmd", "sub1", nullptr
- };
- auto argv = const_cast<char **>(args.data());
-
- int ret = nihil::dispatch_command(args.size() - 1, argv);
- REQUIRE(ret == 0);
- REQUIRE(cmd_sub1_called == true);
-}