feat(instrumenter): add FloorDivision mutator (#5642)#6087
Open
baer wants to merge 1 commit into
Open
Conversation
Implements bidirectional mutation between modulo and floor division: - Forward: `a % b` → `Math.floor(a / b)` - Reverse: `Math.floor(x / y)` or `Math.trunc(x / y)` → `x % y` Updates the benchmark-big.ts perf test expected mutant count from 933 to 942, reflecting 9 new mutants introduced by this mutator (+7 from `%` operators and +2 from `Math.floor(x / y)` calls in that fixture).
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.
Adds a
FloorDivisionmutator that swaps between modulo and floor division, as requested in #5642.a % b→Math.floor(a / b)Math.floor(a / b)→a % bMath.trunc(a / b)→a % bThe forward direction only emits
Math.floor, notMath.trunc— the two differ only for negative operands, so a second forward mutant would be near-redundant. The reverse direction accepts both so existingfloor/trunccode gets mutated either way.Closes #5642