Repository navigation
Self-mutation with PSMutant 0.8.0's new operators; config paths resolved the same on every PowerShell - #215
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4PLMohmpdckWENoxtHAyn
Adds ComparisonOperator, CaseSensitivity, BitwiseOperator and StringOperatorRemoval, and declares the two equivalent -join removals in Get-PSCxUnifiedDiff and Get-PSCxMarkdownDocument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4PLMohmpdckWENoxtHAyn
PowerShell 7.6 made Join-Path -ChildPath a string[], so the -join in Get-PSCxConfigFull did nothing on 7.6 and was required on 7.0 to 7.5. StringOperatorRemoval's mutant survived the 7.6 suite for that reason. The segments now go in through -AdditionalChildPath, which behaves the same from 6.0 on. Opens 0.7.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4PLMohmpdckWENoxtHAyn
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.
Stacked on #214 (the PSMutant 0.8.0 pin); merge that first.
The operators
Turns on the four opt-in operators PSMutant 0.8.0 added:
ComparisonOperator,CaseSensitivity,BitwiseOperatorandStringOperatorRemoval. #211 already killed the survivors they found. Two equivalents are declared, keyed by function:Get-PSCxUnifiedDiff:$Text -join "`n" -> $Text. The joined text is split on line breaks next, and-spliton an array splits each element and flattens.Get-PSCxMarkdownDocument:$scope -join ' ' -> $scope. The value goes into a[string[]]cast, which joins an inner array with$OFS, a single space.The fix this needed: 0.7.1
The first CI run left one survivor on Linux, and it was real. In
Get-PSCxConfigFull, removing the-joinsurvived because PowerShell 7.6 madeJoin-Path -ChildPathastring[](PowerShell/PowerShell#24677, a deliberate breaking change). On 7.6 the-joindid nothing; on 7.0 to 7.5 it was required, andJoin-Pathrefuses an array there. My local run used 7.5.11, which is why it killed the mutant and CI didn't.The segments now go in through
-AdditionalChildPath, which behaves the same from 6.0 on. With no-joinleft, there's nothing that only an old host can detect. The path a config resolves to is unchanged; a path with no segments, which would differ by a trailing slash, is already refused by validation. This is asrc/change, so it opens 0.7.1 with a CHANGELOG entry.Measured locally
Config.ps1after the fix: 100%, 197 of 197, on both 7.6.7 and 7.5.11.The general question of how to handle version differences is in the two issues filed next to this.
🤖 Generated with Claude Code
https://claude.ai/code/session_01L4PLMohmpdckWENoxtHAyn