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
Since version 2.3.5 doctest supports new assertion macros that assert both exception type and message, in the form of *_THROWS_WITH_AS (e.g. CHECK_THROWS_WITH_AS).
With those, some code duplication in unit tests can be avoided, as for example the following (test/src/unit-constructor1.cpp):
CHECK_THROWS_AS((j.get<std::pair<int, int>>()), json::out_of_range&);
CHECK_THROWS_WITH((j.get<std::pair<int, int>>()), "[json.exception.out_of_range.401] array index 1 is out of range");
can be replaced with:
CHECK_THROWS_WITH_AS((j.get<std::pair<int, int>>()), "[json.exception.out_of_range.401] array index 1 is out of range", json::out_of_range&);
Would you be interested in that? If so, I can create a pull request.
The text was updated successfully, but these errors were encountered:
Hello,
Since version 2.3.5 doctest supports new assertion macros that assert both exception type and message, in the form of
*_THROWS_WITH_AS
(e.g.CHECK_THROWS_WITH_AS
).With those, some code duplication in unit tests can be avoided, as for example the following (test/src/unit-constructor1.cpp):
can be replaced with:
Would you be interested in that? If so, I can create a pull request.
The text was updated successfully, but these errors were encountered: