Commit 336f1a9
test(TASK-026): RED route() generic registration suite
Adds test/unit/webserver_route_test.cpp covering:
- Compile-time signature contract for both new public overloads:
route(http_method, const string&, std::function<...>) and
route(method_set, const string&, std::function<...>) returning void.
- Runtime curl tests for single-method route() (GET/POST), 405 with
Allow header for unregistered methods, the headline acceptance test
(load (method, path) pairs from a vector at runtime and dispatch
via route()), method_set GET+HEAD both serve, method_set partial
overlap with an existing handler throws atomically (POST stays
unregistered), empty method_set throws, http_method::count_
sentinel throws, duplicate / cross-overload conflicts with on_*
throw, parameterized path binds through the regex tier, empty
std::function throws on either overload.
Wires the new TU into test/Makefile.am (check_PROGRAMS +
webserver_route_SOURCES). Build of the test currently fails to
compile because webserver::route is missing -- this is the RED gate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 39c3c0d commit 336f1a9
2 files changed
Lines changed: 447 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
185 | 198 | | |
186 | 199 | | |
187 | 200 | | |
| |||
0 commit comments