You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'd like to have the ability to expect the throwing of an C++ exception in CCSpec tests. We'd also like to reuse the usual expect(...).to(...) syntax:
So we'd need a new special matcher class ThrowException that copes with exceptions. Its friend constructor would be throw_exception. The constructor takes a template argument as the type of exception to match. For now the constructor can be nullary (later on it can also take a message to match std::exception::what()).
For now, if the matcher expects an exception but no exception is thrown, the error message can be:
[function object] should throw [Exception name]
OR [function object] should not throw [Exception name]
The text was updated successfully, but these errors were encountered:
We'd like to have the ability to expect the throwing of an C++ exception in CCSpec tests. We'd also like to reuse the usual
expect(...).to(...)
syntax:So we'd need a new special matcher class
ThrowException
that copes with exceptions. Its friend constructor would bethrow_exception
. The constructor takes a template argument as the type of exception to match. For now the constructor can be nullary (later on it can also take a message to matchstd::exception::what()
).For now, if the matcher expects an exception but no exception is thrown, the error message can be:
[function object] should throw [Exception name]
OR
[function object] should not throw [Exception name]
The text was updated successfully, but these errors were encountered: