Ask the contract whether the number branch admits an integer; refuse multiples a double cannot spell (0.15.2) - #134
Merged
Conversation
…multiples a double cannot spell; rector on every PR numberBranchAdmits() held a copy of the float multipleOf rule the contract left in 0.12.1, and the two disagreed on 4670 of the integers in ±100000 for 0.7: the generator kept 58254 on the integer branch, the contract saw it on both. SchemaCheck::isMultipleOf() is the verdict now (#132). A number bound so wide that its decimal multiples need more significant digits than a double holds fails closed at compile time; a multiple that divides one is exempt (#133). static-analysis.yml runs rector on every PR: 0.15.0 shipped with a rule red.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced 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.
Fixes #132
Fixes #133
CompositionArbitraries::numberBranchAdmits()judged the number branch'smultipleOfby a copy of the float rule the contract left in 0.12.1; the copy disagreed on 4670 of the integers in ±100000 for0.7(58254kept on the integer branch, seen on both by the contract). The verdict isSchemaCheck::isMultipleOf()(openapi-contract 0.12.2, required^0.12.2). Zooamounts.creategainsstep(0.7beside a wide integer branch); corpus re-recorded in openapi-contract#156.numberbound so wide that|bound| × 10^decimals > 2^53fails closed at compile time; a multiple that divides one (1,0.5,0.25) is exempt. A property (300 runs, nine multiples, bounds to 1e9) pins that every generated multiple is one to the contract.static-analysis.ymlrunscomposer rectoron every PR — 0.15.0 shipped rector-red.