Repository navigation
Conversation
The five AppendFormat_WithProvider_* tests used new CultureInfo("de-DE")
and asserted "1.234,56". With DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 this
culture is unavailable, so the tests error out and the Stryker initial test
run aborts ("more than 50% failing tests").
Use an explicit NumberFormatInfo (and an invariant-culture clone carrying it
for the CurrentCulture test) so the suite passes with or without ICU.
Assertions are unchanged.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #442 +/- ##
=======================================
Coverage 91.76% 91.76%
=======================================
Files 15 15
Lines 340 340
Branches 100 100
=======================================
Hits 312 312
Misses 17 17
Partials 11 11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Problem
ThrowIfInPast/ThrowIfInFuture(ArgumentOutOfRangeExceptionPolyfills.cs,#if NET8_0_OR_GREATER) leave surviving mutants in the Stryker report: null-coalescing(timeProvider ?? TimeProvider.System)in all 6 overloads,</>boundary equality mutants for DateTime and DateTimeOffset, and exception message string mutants. The 17-survivor figure comes from the Stryker report (not present in the run log); the overall latest mutation score of this repo is 27.10%.Root cause
No test passes a
TimeProvider, so the parameter is effectively untested, and the real clock cannot produce a value exactly equal to "now".Change
Tests only, in the two existing files
ArgumentOutOfRangeException_ThrowIfInPastTests.csand..._ThrowIfInFutureTests.cs: a small privateTimeProvidersubclass returning a fixed instant (2100-01-01 for InPast, 2000-01-01 for InFuture, so the result differs from the real clock). For DateOnly, DateTime and DateTimeOffset: value == now does not throw; value one tick/day off throws, withMessage.Contains("Value must not be in the past/future"). No new dependency.Before / After
Risk / what this does not change
Test-only change; no production code touched. Kill counts are estimates until the mutation run on this branch completes.
Measured run: https://github.com/dailydevops/codebuilder/actions/runs/40805858858 (dispatch on this branch, success, about 6 min). As expected the score is unchanged; the CI run cannot show the invariant=1 benefit, which is shown by the local test results above.