Catch exceptions from StringMakers inside Detail::stringify

This stops tests failing falsely if the assertion passed, but the
stringification itself failed as the assertion was sent to the reporter.

I don't think that stringification should be fallible, but the
overhead in compilation ended up being small enough (<0.5% on `SelfTest`)
that it might be worth implementing, in case there is more users
with weird `StringMaker`s than just MongoDB.

Closes #2980
This commit is contained in:
Martin Hořeňovský
2025-08-01 23:23:34 +02:00
parent 17fe5eaa5c
commit c5e0ef4e67
20 changed files with 129 additions and 20 deletions

View File

@@ -1719,6 +1719,6 @@ due to unexpected exception with message:
Why would you throw a std::string?
===============================================================================
test cases: 433 | 333 passed | 76 failed | 7 skipped | 17 failed as expected
assertions: 2270 | 2093 passed | 136 failed | 41 failed as expected
test cases: 434 | 334 passed | 76 failed | 7 skipped | 17 failed as expected
assertions: 2271 | 2094 passed | 136 failed | 41 failed as expected