Repository navigation
test: bring the test assembly to 100% line coverage - #373
Merged
Merged
Conversation
Chris-Wolfgang
added this pull request to stack #375
September 26, 2026 19:46
The test assembly measured 97.7%; every gap was a line that cannot run while the test passes: - Doc/README compile tests: the Assert.Fail branch only ran on a broken snippet. Assert.True(errors.Count == 0, message) runs the message builder on every pass. The missing-file `yield break` guards now let Load/ReadAllText throw FileNotFoundException naming the path, instead of silently producing zero theory rows. - PropertyTests: the whitespace-message skip was a workaround for #273, which is fixed. The property now asserts the type-name fallback. - RunAsyncFuncTests: the mid-flight cancellation probe no longer has an unreachable `return 42;` after an infinite delay (TaskCompletionSource canceled by the token). The already-canceled tests add a positive control that invokes the probe, proving the not-invoked assertion is not vacuous. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chris-Wolfgang
force-pushed
the
test/test-assembly-full-coverage
branch
from
September 26, 2026 21:33
643bbbf to
56dc737
Compare
This was referenced Sep 26, 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.
Summary
Steps 2 and 3 of #310. The test assembly was already instrumented (
IncludeTestAssemblycame in with #343) and measured 97.7%. Every gap was a line that cannot execute while the test passes. Each one is fixed without weakening the test.DocExampleCompilationTestsif (errors.Count > 0) Assert.Fail(Format(...))→Assert.True(errors.Count == 0, Format(...)), so the message builder runs on a pass. The missing-XML-docyield breakguard is removed, soXDocument.LoadthrowsFileNotFoundExceptionnaming the path instead of silently producing zero rows.ReadmeExampleCompilationTestsLocateReadmeis a singlewhileloop and returns a path that doesn't exist when nothing is found, soReadAllTextfails loudly. The old version returned a bare"README.md"and yielded nothing.PropertyTeststrue, so it tests more than before.RunAsyncFuncTestsreturn 42;afterTask.Delay(Infinite). It now returns aTaskCompletionSourcethat the token cancels, and still assertsTaskCanceledException. The two already-canceled tests add a positive control: they invoke the probe afterwards and assert it flips, which proves theAssert.False(wasInvoked)isn't vacuous.Heads-up, test-code changes: these edit existing tests, so please review the table above.
Verification
dotnet build -c Release -p:TreatWarningsAsErrors=true, test project, all 10 TFMs: 0 errors.dotnet test --filter "Category!=Fuzz"with--settings coverlet.runsettings: net10.0 145 passed, net48 106 passed. Merged ReportGenerator summary:Wolfgang.TryPattern100%,Wolfgang.TryPattern.Tests.Unit100%, no class under 100%.Not in this PR (remaining #310 steps)
pr.yamlstill reads with a barewhile read -r lineand gates everything atCODECOV_MINIMUM(90%). repo-template already has the fix (IFS=plus a 100% test-assembly gate). It's a protected-file change, so it goes in a separate bypass PR.release.yamlparity.Refs #310
🤖 Generated with Claude Code