[CXX-2470] test_util for matching exceptions should produce clearer explanation Created: 17/Mar/22 Updated: 28/Oct/23 Resolved: 22/Mar/22 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | Testing |
| Affects Version/s: | None |
| Fix Version/s: | 3.7.0 |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Jesse Williamson (Inactive) | Assignee: | Jesse Williamson (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Our current Catch2 helper for matching against an expected exception message produces this output on failure: with expansion: While certainly useful, it is misleading: the exception does NOT contain the message "parse error". Instead, that is the message it was /expected/ to contain: std::string describe() const override { return std::string("mongocxx::exception contains message: \"") + expected_msg + "\""; }If the reader of the test message trusts the explanation, this can cause some real head-scratching. This should be corrected so that the intent and output match, something like: exception was expected to contain: "parse error" |
| Comments |
| Comment by Jesse Williamson (Inactive) [ 21/Mar/22 ] |