Skip to content

fix: use Environment.NewLine in AppendIsIncomplete failure messages#966

Merged
vbreuss merged 1 commit into
mainfrom
fix/append-is-incomplete-line-endings
May 18, 2026
Merged

fix: use Environment.NewLine in AppendIsIncomplete failure messages#966
vbreuss merged 1 commit into
mainfrom
fix/append-is-incomplete-line-endings

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented May 18, 2026

Two return paths in AppendIsIncomplete were C# raw-string literals whose newlines are embedded at compile time from the source file's line endings. The official NuGet builds on Linux (LF), but the surrounding Formatter.Format output uses Environment.NewLine at runtime — so Windows consumers got messages with mixed \r\n and bare \n in the "(… and maybe others)" block.

Replace the raw strings with explicit concatenation using Environment.NewLine so the appended newlines match what Formatter.Format already produces.


…es (#965)

Two return paths in `AppendIsIncomplete` were C# raw-string literals
whose newlines are embedded at compile time from the source file's
line endings. The official NuGet builds on Linux (LF), but the
surrounding `Formatter.Format` output uses `Environment.NewLine` at
runtime — so Windows consumers got messages with mixed `\r\n` and
bare `\n` in the "(… and maybe others)" block.

Replace the raw strings with explicit concatenation using
`Environment.NewLine` so the appended newlines match what
`Formatter.Format` already produces.
@vbreuss vbreuss self-assigned this May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 16:33
@vbreuss vbreuss added the bug Something isn't working label May 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes mixed line-ending output in AppendIsIncomplete by replacing raw-string literals (whose newlines are baked in at compile time from source file EOLs) with explicit concatenation using Environment.NewLine, ensuring consistent newlines regardless of build host vs. runtime OS.

Changes:

  • Replace two raw-string returns with Environment.NewLine-based concatenation.
  • Leaves the third return (single-line, no embedded newline) unchanged.

@vbreuss vbreuss enabled auto-merge (squash) May 18, 2026 16:35
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

     23 files   - 27       23 suites   - 27   8m 50s ⏱️ +34s
 19 823 tests  - 27   19 822 ✅  - 27  1 💤 ±0  0 ❌ ±0 
102 440 runs   - 81  102 439 ✅  - 81  1 💤 ±0  0 ❌ ±0 

Results for commit 89386ce. ± Comparison against base commit a9e05ce.

This pull request removes 3195 and adds 3168 tests. Note that renamed tests count towards both.
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message1ba1e4ef-8e32-4ee4-acf3-c01775a33360")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message1d016e04-df31-4fa3-aa73-bb27ee42a429")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message3da9ed44-bf07-43d4-bdaf-251e8158f7ec")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message503b50ee-5ad4-4fb6-8cb0-9acd51f27ae6")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message85511b7d-16b4-482c-a100-c0aae59d3ba7")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messagecbe050f9-0f24-48eb-b1e4-ff9d4ee0e6a3")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message20813571-43c5-4c2d-a4fd-3302d9f55e33")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message4a2d9730-f754-4b9f-8a41-133484e5b8c3")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message58b48720-4b33-4215-bffa-537af4b5c83f")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message663745d5-e176-4eaf-9b67-e53c1ad17fcd")
…
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message0d28ac1b-9d37-4484-9885-c54654409f43")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message651b242e-379e-49b0-ab12-80bf5afe1bc2")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messageab64b681-784d-41b4-9c21-a6ffca80398f")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messagec65cd164-6d55-4370-8414-ed1b460766a3")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messageda666937-f17e-4b6c-9345-2ea050d77288")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messagedb0bff1f-4250-4fc3-a1fc-49932fc55f53")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message0e1a9acd-4fdc-457b-a799-ce40570c1868")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message346240c3-eb0c-4a3c-b343-b80ba014a5ea")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message41a8797e-863a-4e36-998a-c22654bf2ce8")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "messagec41293e3-a2b6-496b-be4d-06ca8da2bc9b")
…

@vbreuss vbreuss merged commit d5f54ae into main May 18, 2026
14 checks passed
@vbreuss vbreuss deleted the fix/append-is-incomplete-line-endings branch May 18, 2026 16:42
github-actions Bot added a commit that referenced this pull request May 18, 2026
…ndIsIncomplete` failure messages (#966) by Valentin Breuß
github-actions Bot added a commit that referenced this pull request May 18, 2026
…ndIsIncomplete` failure messages (#966) by Valentin Breuß
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.300
[Host] : .NET 8.0.27 (8.0.27, 8.0.2726.22922), X64 RyuJIT x86-64-v3

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

Method Mean Error StdDev Gen0 Gen1 Allocated
Bool_aweXpect 238.9 ns 1.73 ns 1.53 ns 0.0415 - 696 B
Bool_FluentAssertions 247.1 ns 0.77 ns 0.69 ns 0.0567 - 952 B
Equivalency_aweXpect 308,064.7 ns 1,325.33 ns 1,106.71 ns 20.0195 0.4883 335444 B
Equivalency_FluentAssertions 2,324,745.9 ns 12,334.03 ns 10,933.80 ns 289.0625 46.8750 4841651 B
Int_GreaterThan_aweXpect 249.6 ns 0.53 ns 0.47 ns 0.0515 - 864 B
Int_GreaterThan_FluentAssertions 248.0 ns 0.57 ns 0.53 ns 0.0730 - 1224 B
ItemsCount_AtLeast_aweXpect 471.5 ns 8.95 ns 8.37 ns 0.0811 - 1360 B
ItemsCount_AtLeast_FluentAssertions 486.9 ns 4.77 ns 4.46 ns 0.1192 - 2008 B
String_aweXpect 462.6 ns 5.33 ns 4.98 ns 0.0672 - 1128 B
String_FluentAssertions 1,186.0 ns 11.20 ns 9.93 ns 0.2346 - 3944 B
StringArray_aweXpect 1,917.6 ns 23.14 ns 21.64 ns 0.1564 - 2624 B
StringArray_FluentAssertions 1,296.8 ns 8.72 ns 7.28 ns 0.2480 - 4152 B
StringArrayInAnyOrder_aweXpect 2,505.6 ns 15.57 ns 14.56 ns 0.1678 - 2816 B
StringArrayInAnyOrder_FluentAssertions 19,712.9 ns 148.50 ns 131.64 ns 1.9836 0.0610 33471 B

@github-actions
Copy link
Copy Markdown
Contributor

👽 Mutation Results

Mutation testing badge

aweXpect

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants
That/Collections/CollectionHelpers.cs 92.78% 89 5 1 2 29 40 90 7 166

The final mutation score is 92.78%

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

aweXpect.Core

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

The final mutation score is NaN%

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

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AppendIsIncomplete emits inconsistent line endings in failure messages

2 participants