mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Truncate excessively long messages rather than asserting
This commit is contained in:
parent
aafed303bb
commit
39ef46a02e
@ -23,7 +23,10 @@ namespace Catch {
|
|||||||
std::string remainder = _str;
|
std::string remainder = _str;
|
||||||
|
|
||||||
while( !remainder.empty() ) {
|
while( !remainder.empty() ) {
|
||||||
assert( lines.size() < 1000 );
|
if( lines.size() >= 1000 ) {
|
||||||
|
lines.push_back( "... message truncated due to excessive size" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
std::size_t tabPos = std::string::npos;
|
std::size_t tabPos = std::string::npos;
|
||||||
std::size_t width = (std::min)( remainder.size(), _attr.width - indent );
|
std::size_t width = (std::min)( remainder.size(), _attr.width - indent );
|
||||||
std::size_t pos = remainder.find_first_of( '\n' );
|
std::size_t pos = remainder.find_first_of( '\n' );
|
||||||
|
Loading…
Reference in New Issue
Block a user