MCPcopy Create free account
hub / github.com/boost-ext/ut / main

Function main

example/exception.cpp:11–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <stdexcept>
10
11int main() {
12 using namespace boost::ut;
13
14 "exceptions"_test = [] {
15 expect(throws<std::runtime_error>([] {
16 throw std::runtime_error{"exception!"};
17 })) << "throws runtime_error";
18 expect(throws([] { throw 0; })) << "throws any exception";
19 expect(nothrow([] {})) << "doesn't throw";
20 };
21}

Callers

nothing calls this directly

Calls 3

expectFunction · 0.85
throwsFunction · 0.85
nothrowFunction · 0.85

Tested by

no test coverage detected