Repository navigation
feat: add NormalizingWhiteSpace() to compare strings with collapsed whitespace - #1842
Merged
Merged
Conversation
… whitespace The string options covered whitespace at the edges, the indentation and the newline style, but not whitespace inside a line, so comparing generated SQL, HTML or log output failed on double spaces, tabs or a different line layout. `NormalizingWhiteSpace()` collapses every run of Unicode whitespace, including line breaks, to a single space and trims both ends, on the subject and the expected value, and is available wherever the other string options are. - it supersedes `IgnoringIndentation()`, `IgnoringNewlineStyle()`, `IgnoringLeadingWhiteSpace()` and `IgnoringTrailingWhiteSpace()`, which can still be combined with it; like them it can be specified only once and cannot be combined with `AsBlock()` - wildcard and regex patterns are normalized as well; a prefix, suffix or substring keeps the whitespace at its inner end, which then has to match whitespace in the subject unless that end reaches the end of the subject - a failure shows the normalized values and the position of the first mismatch refers to them, as collapsed whitespace cannot be mapped back to the original lines and columns; the original subject is listed below, and no line differences are listed The build scope is set to `CoreOnly`, because the option lives in aweXpect.Core and the aweXpect tests and docs use it.
vbreuss
enabled auto-merge (squash)
October 16, 2026 15:26
|
Contributor
|
This is addressed in release v3.4.0. |
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The string options covered whitespace at the edges, the indentation and the newline style, but not whitespace inside a line, so comparing generated SQL, HTML or log output failed on double spaces, tabs or a different line layout.
NormalizingWhiteSpace()collapses every run of Unicode whitespace, including line breaks, to a single space and trims both ends, on the subject and the expected value, and is available wherever the other string options are.IgnoringIndentation(),IgnoringNewlineStyle(),IgnoringLeadingWhiteSpace()andIgnoringTrailingWhiteSpace(), which can still be combined with it; like them it can be specified only once and cannot be combined withAsBlock()