diff options
| author | Martin Hořeňovský | 2021-10-25 15:10:35 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-10-25 15:21:28 +0200 |
| commit | 905bf438ae4358d1e6b9fb99be40f868589d0857 (patch) | |
| tree | aa35e86f965a4142b76233738499a2e461d58d54 /tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp | |
| parent | 0fdee1c27362f18f2769ba13d9a2f74823b3b8c4 (diff) | |
| download | catch3-905bf438ae4358d1e6b9fb99be40f868589d0857.tar.gz | |
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
Diffstat (limited to 'tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp')
| -rw-r--r-- | tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp index 69d05eef..5c95657d 100644 --- a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp @@ -107,3 +107,8 @@ TEST_CASE( "Reporter's write listings to provided stream", "[reporters]" ) { } } } + + +TEST_CASE("Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla", "[console-reporter]") { + SUCCEED(); +} |