fix: restrict UOI mutations to identifier primaries only#127
Merged
Conversation
Performance Comparison (same runner)Regressions
Stable
|
b8f6a61 to
446a74b
Compare
SamanAttar
commented
Jun 1, 2026
…pex-mutation-testing into fix/uoi-non-id-primaries-126
|
Published under sf plugins install https://github.com/scolladon/apex-mutation-testing/releases/download/dev-pr-127/apex-mutation-testing-dev-pr-127.tgz |
|
Shipped in release $ sf plugins install apex-mutation-testing@latest-rc
# Or
$ sf plugins install apex-mutation-testing@v1.7.1💡 Enjoying apex-mutation-testing? |
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.
Explain Your Changes
The UOI mutator was generating mutations for primary expressions that are not valid assignment targets. Specifically literals (
42,'hello',true,null),this,super, SOQL/SOSL queries, type references,void, and expressions used as the receiver of a dot or safe-navigation expression (e.g.foo.bar).Instead of maintaining an ad-hoc denylist of non-assignable text patterns, this will help simplify the mutator but using an allowlist: it only generates mutations when the primary child is an
IdPrimaryContext(a plain identifier like x or myVar). All other primary types are rejected by construction.The
DotExpressionContextparent check is added to guard against dot-receiver positions that would also produce invalid mutations as an early exit.The
isLiteralprivate helper has been removed as it is no longer needed.closes #126
Any particular element that can be tested locally
Any other comments