From 43e44bc35b18c7e6938d8b5103ae8a76dd06f5a0 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 22 Sep 2026 16:27:21 +0200 Subject: lib/routers: introduce router concept --- ttwhy/routers/echo.tests.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'ttwhy/routers/echo.tests.cpp') 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; + }; + + 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>); + STATIC_REQUIRE_FALSE(ttwhy::router); + STATIC_REQUIRE_FALSE(ttwhy::router); + STATIC_REQUIRE_FALSE(ttwhy::router); +} + SCENARIO("The echo router handles terminal navigation within the valid printed area", "[router][echo]") { GIVEN("An initialized echo router with a mock stream") -- cgit v1.2.3