Reach core 0.3's edge-case switch from the chain and the environment - #6
Merged
Conversation
The numeric generators return an in-range edge value roughly one draw in five. That is right until the edges are what a property cannot use — a body discarding 0, a range end that violates a precondition — and then one run in five is spent producing a value the property throws away. Core 0.3 added the switch; nothing here could set it. PROPERTY_EDGE_CASES follows the rule the rest of the table already follows — the environment dials the suite, the code pins the property — so the variable wins over edgeCases(). An unknown value throws instead of falling back: a suite that quietly kept the bias it was told to drop would spend exactly the discard budget it was trying to save. Two mutants earned their tests on the way. One of the new tests was named without the `test` prefix and therefore never ran, which the mutation report noticed and the green suite did not; and the message's trim() was only exercised by a value that had nothing to trim, so the unknown-value test now passes one with spaces.
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Parity wave for core 0.3.0's
EdgeCases— the twin ofproperty-testing-testo#7, same variable, same messages.Why
The numeric generators return an in-range edge value (
0,±1,min,max) roughly one draw in five, because bugs cluster there. That stops being useful when the edges are exactly what a property cannot use — a body discarding0throughAssume::that(), a range end that violates a precondition — and then one run in five produces a value the property throws away while the discard budget pays for it.The variable overrides the chain, following the rule the rest of the table already follows: the environment dials the suite, the code pins the property. An unknown value throws rather than falling back to the default — a suite that quietly kept the bias it was told to drop would spend exactly the discard budget it was trying to save.
Two mutants earned their tests
Worth stating because the green suite hid both:
testprefix and therefore never ran. PHPUnit reported 64 green tests either way; the mutation report is what noticed;trim()was only exercised by a value with nothing to trim, so the unknown-value test now passes one with spaces and asserts the trimmed quote.Checks
composer buildgreen against core^0.3from Packagist: 65 tests, ~2.3k assertions;infection.json5's comment is updated;bin/package-audit: 0 errors, 0 warnings;llms.txt,AGENTS.md's environment table and CHANGELOG updated together.