diff --git a/src/testing/testing.hpp b/src/testing/testing.hpp index cf2e18d..50fe43c 100644 --- a/src/testing/testing.hpp +++ b/src/testing/testing.hpp @@ -178,5 +178,21 @@ namespace lpstd testSuite(); } + void testThrow(std::function testCase) + { + try + { + testCase(); + } + catch (std::exception &e) + { + std::cout << "✅ Expected exception thrown: " << e.what() << std::endl; + Results.passed++; + return; + } + std::cout << "❌ Expected exception not thrown" << std::endl; + Results.failed++; + } + } }