snitch-org / snitch

Lightweight C++20 testing framework.
Boost Software License 1.0
252 stars 7 forks source link

Escaped characters in XML or TeamCity reporters can be truncated incorrectly #164

Closed cschreib closed 2 months ago

cschreib commented 2 months ago

Some reporters (e.g. the XML reporter) require some characters to be escaped (e.g., & -> &). Because messages have a finite length and can be truncated, there were cases where the truncation happened in the middle of an escape sequence.

For example:

Hello this is me & my friend

being truncated to

Hello this is me &am...

The escaping logic needs to account for this, and avoid truncating in the wrong place.