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

@@ -241,6 +241,7 @@
:test-result: PASS String matchers
:test-result: PASS StringRef
:test-result: PASS StringRef at compilation time
:test-result: PASS Stringifying bla bla bla
:test-result: PASS Stringifying char arrays with statically known sizes - char
:test-result: PASS Stringifying char arrays with statically known sizes - signed char
:test-result: PASS Stringifying char arrays with statically known sizes - unsigned char