-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mutations + math float tests #427
Conversation
Pull Request Test Coverage Report for Build 6605143985
💛 - Coveralls |
c4b736c
to
04c4d89
Compare
04c4d89
to
66dee5d
Compare
"@default": true, | ||
"Break_": { | ||
"ignore": [ | ||
"Psl\\Collection\\*Map::zip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the break gets transformed into a continue, it will produce the same output - yet slower.
So this is a false positive:
psl/src/Psl/Collection/Map.php
Lines 378 to 380 in 4affb62
$u = $elements[0] ?? null; | |
if (null === $u) { | |
break; |
}, | ||
"DecrementInteger": { | ||
"ignore": [ | ||
"Psl\\DataStructure\\PriorityQueue::peek" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fallback to ?? 0
will never occur since we first check the array size.
This is a false positive:
$priority = Math\max($keys) ?? 0; |
I could solve it by doing an additional invariant
check, but this seems slower for no real reason.
}, | ||
"FunctionCallRemoval": { | ||
"ignore": [ | ||
"Psl\\Result\\Success::getThrowable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is actually covered - yet infection doesnt seem to be able to link the test to the mutation.
See
psl/tests/unit/Result/SuccessTest.php
Lines 34 to 42 in 4affb62
public function testGetException(): void | |
{ | |
$wrapper = new Success('hello'); | |
$this->expectException(InvariantViolationException::class); | |
$this->expectExceptionMessage('No exception thrown'); | |
$wrapper->getThrowable(); | |
} |
}, | ||
"LogicalNot": { | ||
"ignore": [ | ||
"Psl\\Hash\\Context::update" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard to cover this one:
Lines 74 to 79 in 4affb62
// @codeCoverageIgnoreStart | |
/** @psalm-suppress ImpureFunctionCall - it creates a copy of the context, so we can consider it pure! */ | |
if (!hash_update($internal_context, $data)) { | |
throw new Exception\RuntimeException('Unable to pump data into the active hashing context.'); | |
} | |
// @codeCoverageIgnoreEnd |
(the code coverage was already added as well.)
}, | ||
"MethodCallRemoval": { | ||
"ignore": [ | ||
"Psl\\Iter\\Iterator::seek", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions were added to speed up the tests : it results in time-outs cause the iterator does not iterate anymore because it removes:
Line 181 in 4affb62
$this->next(); |
}, | ||
"Throw_": { | ||
"ignore": [ | ||
"Psl\\File\\ReadHandle::__construct", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some tests as well - but didnt want to go into chmodding files and testing for readability / writability at this moment.
See
psl/src/Psl/File/ReadHandle.php
Lines 25 to 35 in 4affb62
if (!Filesystem\exists($file)) { | |
throw Exception\NotFoundException::for($file); | |
} | |
if (!Filesystem\is_file($file)) { | |
throw Exception\NotFileException::for($file); | |
} | |
if (!Filesystem\is_readable($file)) { | |
throw Exception\NotReadableException::for($file); | |
} |
} | ||
|
||
public function provideData(): array | ||
{ | ||
return [ | ||
[ | ||
-3.380515006246586, | ||
5.0 | ||
5.0, | ||
0.00000000000001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is off by one on my system for some odd reason. Therefor I decided to check only the first 14 digits
[![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [azjezz/psl](https://togithub.com/azjezz/psl) | `2.7.0` -> `2.8.0` | [![age](https://developer.mend.io/api/mc/badges/age/packagist/azjezz%2fpsl/2.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/azjezz%2fpsl/2.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/azjezz%2fpsl/2.7.0/2.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/azjezz%2fpsl/2.7.0/2.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>azjezz/psl (azjezz/psl)</summary> ### [`v2.8.0`](https://togithub.com/azjezz/psl/releases/tag/2.8.0): Lenalee - 2.8.0 [Compare Source](https://togithub.com/azjezz/psl/compare/2.7.0...2.8.0) #### What's Changed - chore(ga): bump actions/checkout from 3 to 4 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/azjezz/psl/pull/420](https://togithub.com/azjezz/psl/pull/420) - Fix mutations + math float tests by [@​veewee](https://togithub.com/veewee) in [https://github.com/azjezz/psl/pull/427](https://togithub.com/azjezz/psl/pull/427) - Introduce a comparison component by [@​veewee](https://togithub.com/veewee) in [https://github.com/azjezz/psl/pull/428](https://togithub.com/azjezz/psl/pull/428) - Indicate support for PHP 8.3 by [@​gsteel](https://togithub.com/gsteel) in [https://github.com/azjezz/psl/pull/430](https://togithub.com/azjezz/psl/pull/430) #### New Contributors - [@​gsteel](https://togithub.com/gsteel) made their first contribution in [https://github.com/azjezz/psl/pull/430](https://togithub.com/azjezz/psl/pull/430) **Full Changelog**: azjezz/psl@2.7.0...2.8.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ben-challis/sql-migrations). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR fixes:
(See #425)