aboutsummaryrefslogtreecommitdiff
path: root/ttwhy/routers/echo.tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ttwhy/routers/echo.tests.cpp')
-rw-r--r--ttwhy/routers/echo.tests.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/ttwhy/routers/echo.tests.cpp b/ttwhy/routers/echo.tests.cpp
index f12d08b..c6ea10a 100644
--- a/ttwhy/routers/echo.tests.cpp
+++ b/ttwhy/routers/echo.tests.cpp
@@ -45,8 +45,32 @@ namespace
token, buffers);
}
};
+
+ struct incomplete_router_no_policy
+ {
+ auto process(ttwhy::scanners::input_event) -> asio::awaitable<void>;
+ };
+
+ struct incomplete_router_no_process
+ {
+ using terminal_policy = ttwhy::scanners::xterm_policy;
+ };
+
+ struct incomplete_router_wrong_return
+ {
+ using terminal_policy = ttwhy::scanners::xterm_policy;
+ auto process(ttwhy::scanners::input_event) -> void;
+ };
} // namespace
+TEST_CASE("The router concept validates router candidate interfaces", "[router][concept]")
+{
+ STATIC_REQUIRE(ttwhy::router<ttwhy::routers::echo<mock_stream>>);
+ STATIC_REQUIRE_FALSE(ttwhy::router<incomplete_router_no_policy>);
+ STATIC_REQUIRE_FALSE(ttwhy::router<incomplete_router_no_process>);
+ STATIC_REQUIRE_FALSE(ttwhy::router<incomplete_router_wrong_return>);
+}
+
SCENARIO("The echo router handles terminal navigation within the valid printed area", "[router][echo]")
{
GIVEN("An initialized echo router with a mock stream")