diff options
Diffstat (limited to 'tests/unittest.cpp')
-rw-r--r-- | tests/unittest.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/unittest.cpp b/tests/unittest.cpp index a133bce..460abac 100644 --- a/tests/unittest.cpp +++ b/tests/unittest.cpp @@ -1060,14 +1060,34 @@ TEST(route_dynamic) res.end(); }); - - app.route_dynamic("/set_int/<int>") ([&](int y){ x = y; return ""; }); + try + { + app.route_dynamic("/invalid_test/<double>/<path>") + ([](){ + return ""; + }); + fail(); + } + catch(std::exception&) + { + } + + // app is in an invalid state when route_dynamic throws an exception. + try + { + app.validate(); + fail(); + } + catch(std::exception&) + { + } + { request req; response res; |