arkitect
arkitect copied to clipboard
Fix pattern match
At some point this was correct and then changed into a bug.
I am reverting the change that introduced the bug.
Thanks for you contributions! As you can see from the broken tests this function is used in a lot of places, and reverting to an old behavior is not a valid solution... Which is the exact behavior that you didn't expect? If you have an example would be great :slightly_smiling_face:
@fain182
Reverting the changes and leaving the test as is, we can see that this assertion fails:
$pattern = new PatternString('SoThisIsAnExample');
$this->assertFalse($pattern->matches('*This'));
However, it shouldn't fail because it shouldn't match since there is no wildcard at the end of the string.
@fain182 I removed a duplicate assertion and added a few more to make sure all scenarios are covered.
@fain182 I believe I fixed the issues, can you check the last commits, please?
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.76%. Comparing base (
92dad93) to head (f628a1b).
Additional details and impacted files
@@ Coverage Diff @@
## main #404 +/- ##
============================================
- Coverage 94.79% 94.76% -0.04%
+ Complexity 606 604 -2
============================================
Files 69 69
Lines 1614 1604 -10
============================================
- Hits 1530 1520 -10
Misses 84 84
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@hgraca i need this ;-;
Can we merge it?
@d-cichon as far as I'm concerned, yes. However, I'm not a maintainer, I can't merge anything. Back when I opened these PRs I ended up making my own fork cozz I felt this project was abandoned, no one was merging anything. Not sure how this is now, but u might need to do the same.
@d-cichon @fain182
I see there is work being merged, so I guess this is not abandoned as I thought.
Thus, I opened an issue for this PR, rebased, squashed and force pushed to this branch.
This PR resolves https://github.com/phparkitect/arkitect/issues/457
@fain182 @micheleorselli it seems OK for me, any other opinions?
I rebased and force pushed