aboutsummaryrefslogtreecommitdiff
path: root/ttwhy/routers/echo.tests.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-09-22 18:56:44 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-09-22 18:56:44 +0200
commit22f6534081acfabdab4956d337604a21e7da5b64 (patch)
treea857b256a120d154667f2ed68cbf5151afe0cfbf /ttwhy/routers/echo.tests.cpp
parent676586f2034ff112b309dccc430893d73e919191 (diff)
downloadttwhy-22f6534081acfabdab4956d337604a21e7da5b64.tar.xz
ttwhy-22f6534081acfabdab4956d337604a21e7da5b64.zip
lib: generalize concepts
Diffstat (limited to 'ttwhy/routers/echo.tests.cpp')
-rw-r--r--ttwhy/routers/echo.tests.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/ttwhy/routers/echo.tests.cpp b/ttwhy/routers/echo.tests.cpp
index c6ea10a..da2db40 100644
--- a/ttwhy/routers/echo.tests.cpp
+++ b/ttwhy/routers/echo.tests.cpp
@@ -46,29 +46,27 @@ namespace
}
};
- 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;
};
+
+ struct incomplete_router_wrong_event
+ {
+ auto process(int) -> asio::awaitable<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>);
+ STATIC_REQUIRE(ttwhy::router<ttwhy::routers::echo<mock_stream>, ttwhy::scanners::input_event>);
+ STATIC_REQUIRE_FALSE(ttwhy::router<incomplete_router_no_process, ttwhy::scanners::input_event>);
+ STATIC_REQUIRE_FALSE(ttwhy::router<incomplete_router_wrong_return, ttwhy::scanners::input_event>);
+ STATIC_REQUIRE_FALSE(ttwhy::router<incomplete_router_wrong_event, ttwhy::scanners::input_event>);
}
SCENARIO("The echo router handles terminal navigation within the valid printed area", "[router][echo]")