Skip to content

feat: support IgnoringIndentation() in the string expectations - #1032

Merged
vbreuss merged 1 commit into
mainfrom
feat/ignoring-indentation
Sep 6, 2026
Merged

vbreuss merged 1 commit into
mainfrom
feat/ignoring-indentation

Conversation

@vbreuss

@vbreuss vbreuss commented Sep 6, 2026

Copy link
Copy Markdown
Member

Use StringEqualityOptions.CountOccurrences in ThatString.Contains instead of comparing every window with AreConsideredEqual. The window length was derived from the length of the expected string, so every option that changes that length was applied to each window individually and made the occurrences unfindable. This affected IgnoringIndentation as well as the already existing IgnoringNewlineStyle.

All other string expectations compare the complete strings and already support the new option through the result types of aweXpect.Core.

Update the aweXpect.Core package reference to v2.34.0 and reset the build scope to Default, so that the aweXpect package is built, tested and published again.


Closes #1022

Use `StringEqualityOptions.CountOccurrences` in `ThatString.Contains`
instead of comparing every window with `AreConsideredEqual`. The window
length was derived from the length of the expected string, so every
option that changes that length was applied to each window individually
and made the occurrences unfindable. This affected `IgnoringIndentation`
as well as the already existing `IgnoringNewlineStyle`.

All other string expectations compare the complete strings and already
support the new option through the result types of aweXpect.Core.

Update the `aweXpect.Core` package reference to v2.34.0 and reset the
build scope to `Default`, so that the aweXpect package is built, tested
and published again.
@vbreuss vbreuss self-assigned this Sep 6, 2026
Copilot AI lite review requested due to automatic review settings September 6, 2026 09:47
@vbreuss vbreuss added the enhancement New feature or request label Sep 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vbreuss
vbreuss enabled auto-merge (squash) September 6, 2026 09:49
@sonarqubecloud

sonarqubecloud Bot commented Sep 6, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Test Results

     23 files  +    16       23 suites  +16   9m 10s ⏱️ + 8m 26s
 20 057 tests +18 694   20 055 ✅ +18 693  2 💤 +1  0 ❌ ±0 
103 571 runs  +96 043  103 569 ✅ +96 042  2 💤 +1  0 ❌ ±0 

Results for commit f94d22d. ± Comparison against base commit aa12a55.

@vbreuss
vbreuss merged commit 11994e6 into main Sep 6, 2026
14 checks passed
@vbreuss
vbreuss deleted the feat/ignoring-indentation branch September 6, 2026 09:56
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 8.0.30 (8.0.30, 8.0.3026.36720), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Method Mean Error StdDev Gen0 Gen1 Allocated
Bool_aweXpect 277.5 ns 6.63 ns 6.20 ns 0.0415 - 696 B
Bool_FluentAssertions 237.0 ns 2.29 ns 2.03 ns 0.0567 - 952 B
Equivalency_aweXpect 309,437.9 ns 2,073.93 ns 1,838.49 ns 20.0195 0.4883 335444 B
Equivalency_FluentAssertions 2,588,469.3 ns 25,042.74 ns 23,424.99 ns 289.0625 46.8750 4841651 B
Int_GreaterThan_aweXpect 266.5 ns 3.87 ns 3.62 ns 0.0515 - 864 B
Int_GreaterThan_FluentAssertions 244.1 ns 4.56 ns 4.26 ns 0.0730 - 1224 B
ItemsCount_AtLeast_aweXpect 484.5 ns 6.52 ns 6.10 ns 0.0811 - 1360 B
ItemsCount_AtLeast_FluentAssertions 490.9 ns 2.56 ns 2.27 ns 0.1192 - 2008 B
String_aweXpect 473.3 ns 3.61 ns 3.38 ns 0.0668 - 1128 B
String_FluentAssertions 1,270.3 ns 34.19 ns 31.98 ns 0.2346 - 3944 B
StringArray_aweXpect 1,971.9 ns 24.41 ns 22.83 ns 0.1564 - 2624 B
StringArray_FluentAssertions 1,352.1 ns 14.44 ns 13.51 ns 0.2480 - 4152 B
StringArrayInAnyOrder_aweXpect 2,638.0 ns 13.58 ns 12.71 ns 0.1678 - 2816 B
StringArrayInAnyOrder_FluentAssertions 27,423.8 ns 185.93 ns 173.92 ns 1.9836 0.0610 33471 B

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

👽 Mutation Results

Mutation testing badge

aweXpect

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Runtime Errors Total Detected Total Undetected Total Mutants
That/Strings/ThatString.Contains.cs 98.70% 76 1 0 0 22 24 0 76 1 123

The final mutation score is 98.70%

Coverage Thresholds: high:80 low:60 break:0

aweXpect.Core

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Runtime Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

github-actions Bot added a commit that referenced this pull request Sep 6, 2026
…n the string expectations (#1032) by Valentin Breuß
github-actions Bot added a commit that referenced this pull request Sep 6, 2026
…n the string expectations (#1032) by Valentin Breuß
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

This is addressed in release v2.38.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an IgnoringIndentation() string equality option

2 participants