Skip to content

Reach core 0.3's edge-case switch from the chain and the environment - #6

Merged
rasuvaeff merged 1 commit into
masterfrom
feat/edge-cases
Aug 15, 2026
Merged

Reach core 0.3's edge-case switch from the chain and the environment#6
rasuvaeff merged 1 commit into
masterfrom
feat/edge-cases

Conversation

@rasuvaeff

Copy link
Copy Markdown
Owner

Parity wave for core 0.3.0's EdgeCases — the twin of property-testing-testo#7, same variable, same messages.

$this->forAll(['value' => Gen::intBetween(-1000, 1000)])
    ->edgeCases(EdgeCases::None)
    ->check(…);
PROPERTY_EDGE_CASES=none vendor/bin/phpunit

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 discarding 0 through Assume::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:

  • one of the new tests was named without the test prefix and therefore never ran. PHPUnit reported 64 green tests either way; the mutation report is what noticed;
  • the error message's 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 build green against core ^0.3 from Packagist: 65 tests, ~2.3k assertions;
  • mutation 160/168 killed (MSI 95.2%), gate 90; the eight survivors are the pre-existing equivalent set, none in the new code. The count in infection.json5's comment is updated;
  • bin/package-audit: 0 errors, 0 warnings;
  • README (both languages), llms.txt, AGENTS.md's environment table and CHANGELOG updated together.

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.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d62d507-a1cc-4596-9e34-583de79ea1f9


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rasuvaeff
rasuvaeff merged commit 77a6e95 into master Aug 15, 2026
11 checks passed
@rasuvaeff
rasuvaeff deleted the feat/edge-cases branch August 15, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant