<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/src/catch2/internal/catch_textflow.cpp, branch feature/property-combinators</title>
<subtitle>Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.</subtitle>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/'/>
<entry>
<title>Better handling of ANSI escape codes in TextFlow</title>
<updated>2026-09-13T21:35:34+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2026-09-13T21:35:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=8e2f6f7a876e127a08b1864d028199d6e0961fc6'/>
<id>8e2f6f7a876e127a08b1864d028199d6e0961fc6</id>
<content type='text'>
The new implementation keeps track of found escape codes in a separate
vector, which has two advantages:
1) The handling of inputs without any escape codes is much faster. As
   this will be the case for majority of inputs, this should provide
   nice speedup all around.
2) We no longer mangle unrelated 0xFFs in the user-provided input.

Closes #3199
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new implementation keeps track of found escape codes in a separate
vector, which has two advantages:
1) The handling of inputs without any escape codes is much faster. As
   this will be the case for majority of inputs, this should provide
   nice speedup all around.
2) We no longer mangle unrelated 0xFFs in the user-provided input.

Closes #3199
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid a potential underflow when iterating over invalid inputs</title>
<updated>2026-05-14T08:58:09+00:00</updated>
<author>
<name>Dirk Müller</name>
</author>
<published>2026-05-07T07:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=69e0473f6e98d47c93518424c08ee69ee632c0f0'/>
<id>69e0473f6e98d47c93518424c08ee69ee632c0f0</id>
<content type='text'>
The forward iteration logic already bounds-check for m_it != m_string-&gt;end(),
do the same for the backward iteration. The issue with the assert is
that the assert() might not be compiled in, and it is happening after
the dereference, so it was too late.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The forward iteration logic already bounds-check for m_it != m_string-&gt;end(),
do the same for the backward iteration. The issue with the assert is
that the assert() might not be compiled in, and it is happening after
the dereference, so it was too late.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix counting of UTF-8 codepoints in TextFlow</title>
<updated>2026-04-01T14:12:08+00:00</updated>
<author>
<name>Jan Niklas Hasse</name>
</author>
<published>2026-03-28T15:02:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=572f96b8febec9dd14ac5284e6a959a7246325c8'/>
<id>572f96b8febec9dd14ac5284e6a959a7246325c8</id>
<content type='text'>
For line-wrapping bytes were counted instead of codepoints. This
resulted in line-breaks being inserted at the wrong position and also
breaking UTF-8 characters.

Fixes #1022.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For line-wrapping bytes were counted instead of codepoints. This
resulted in line-breaks being inserted at the wrong position and also
breaking UTF-8 characters.

Fixes #1022.
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle ANSI escape sequences when performing column wrapping (#2849)</title>
<updated>2024-05-04T21:43:52+00:00</updated>
<author>
<name>Jeremy Rifkin</name>
</author>
<published>2024-05-04T21:43:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=8ce2426e53b2596a9823b4a314f72f1c3b30be82'/>
<id>8ce2426e53b2596a9823b4a314f72f1c3b30be82</id>
<content type='text'>
This PR adds functionality to skip around ANSI escape sequences in catch_textflow so they do not contribute to line length and line wrapping code does not split escape sequences in the middle. I've implemented this by creating a AnsiSkippingString abstraction that has a bidirectional iterator that can skip around escape sequences while iterating. Additionally I refactored Column::const_iterator to be iterator-based rather than index-based so this abstraction is a simple drop-in for std::string.

Currently only color sequences are handled, other escape sequences are left unaffected.

Motivation: Text with ANSI color sequences gets messed up when being output by Catch2 #2833.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds functionality to skip around ANSI escape sequences in catch_textflow so they do not contribute to line length and line wrapping code does not split escape sequences in the middle. I've implemented this by creating a AnsiSkippingString abstraction that has a bidirectional iterator that can skip around escape sequences while iterating. Additionally I refactored Column::const_iterator to be iterator-based rather than index-based so this abstraction is a simple drop-in for std::string.

Currently only color sequences are handled, other escape sequences are left unaffected.

Motivation: Text with ANSI color sequences gets messed up when being output by Catch2 #2833.</pre>
</div>
</content>
</entry>
<entry>
<title>Move-enable various parts of TextFlow</title>
<updated>2023-12-27T20:43:49+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2023-12-27T20:43:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=b52d97855d794175e69abc6f0eceee9ec3c1bd0e'/>
<id>b52d97855d794175e69abc6f0eceee9ec3c1bd0e</id>
<content type='text'>
This removes about 200 pointless copies from printing the help
message (the original motivation for the change), and also nicely
improves performance of the various reporters that depend on
TextFlow.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes about 200 pointless copies from printing the help
message (the original motivation for the change), and also nicely
improves performance of the various reporters that depend on
TextFlow.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix references to license file</title>
<updated>2022-10-28T09:30:15+00:00</updated>
<author>
<name>Lars Toenning</name>
</author>
<published>2022-10-28T09:22:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=f1084fb30990fe40c8f5b70034970c7eb4e1da72'/>
<id>f1084fb30990fe40c8f5b70034970c7eb4e1da72</id>
<content type='text'>
The license file was renamed with 6a502cc2f5fedd59b3495b58708f0d6d987ed9e1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The license file was renamed with 6a502cc2f5fedd59b3495b58708f0d6d987ed9e1
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix quadratic runtime when linebreaking strings without newlines</title>
<updated>2021-11-03T23:23:56+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2021-11-03T23:22:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=912df7df354fd6c814b5d7c45ac44f494a5fb5fe'/>
<id>912df7df354fd6c814b5d7c45ac44f494a5fb5fe</id>
<content type='text'>
The problem was that every line would iterate from current line
start position to the end of the string, looking for a newline
to break on, leading to accidentally quadratic runtime. With this
change, the code only ever searches up to the current line's
length and not more.

Credit to @jorgenpt for the fix suggestion.

Closes #2315
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem was that every line would iterate from current line
start position to the end of the string, looking for a newline
to break on, leading to accidentally quadratic runtime. With this
change, the code only ever searches up to the current line's
length and not more.

Credit to @jorgenpt for the fix suggestion.

Closes #2315
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve comments and names in TextFlow::Column</title>
<updated>2021-11-01T18:14:37+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2021-11-01T18:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=70c4ec78fbbfadb19d520c72b83f33cd0915c078'/>
<id>70c4ec78fbbfadb19d520c72b83f33cd0915c078</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Typedef Column::iterator as Column::const_iterator not vice versa</title>
<updated>2021-10-31T12:01:41+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2021-10-31T12:01:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=455ae0c561b6254e05c5fe619b08968187d28a70'/>
<id>455ae0c561b6254e05c5fe619b08968187d28a70</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add standardized copyright notice + SPDX identifier to source files</title>
<updated>2020-08-30T13:43:45+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2020-08-30T13:43:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=90aeffb97d6942d16f75a56b11e10fc0b010995a'/>
<id>90aeffb97d6942d16f75a56b11e10fc0b010995a</id>
<content type='text'>
This should also be done for test files, but that has lower priority.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should also be done for test files, but that has lower priority.
</pre>
</div>
</content>
</entry>
</feed>
