mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-13 18:09:33 +01:00
Fix bad indentation calculation in the console reporter
The problem came from the console reporter trying to provide a
fancy linebreaking (primarily for things like `SCENARIO` or the
BDD macros), so that new lines start with extra indentation if
the text being line broken starts as "{text}: ".
The console reporter did not properly take into account cases
where the ": " part would already be in a later line, in which
case it would ask for non-sensical level of indentation (larger
than single line length).
We fixed this by also enforcing that the special indentation case
only triggers if the ": " is found early enough in the line, so
that we also avoid degenerate cases like this:
```
blablabla: F
a
n
c
y
.
.
.
```
Fixes #2309
This commit is contained in:
@@ -10231,6 +10231,15 @@ with expansion:
|
||||
with message:
|
||||
Tested reporter: xml
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Reproducer for #2309 - a very long description past 80 chars (default console
|
||||
width) with a late colon : blablabla
|
||||
-------------------------------------------------------------------------------
|
||||
Reporters.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Reporters.tests.cpp:<line number>: PASSED:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
SUCCEED counts as a test pass
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -17030,6 +17039,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 372 | 279 passed | 86 failed | 7 failed as expected
|
||||
assertions: 2131 | 1958 passed | 146 failed | 27 failed as expected
|
||||
test cases: 373 | 280 passed | 86 failed | 7 failed as expected
|
||||
assertions: 2132 | 1959 passed | 146 failed | 27 failed as expected
|
||||
|
||||
|
||||
Reference in New Issue
Block a user