arkitect icon indicating copy to clipboard operation
arkitect copied to clipboard

Fix pattern match

Open hgraca opened this issue 2 years ago • 5 comments

At some point this was correct and then changed into a bug.

I am reverting the change that introduced the bug.

hgraca avatar Aug 07 '23 19:08 hgraca

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 avatar Aug 26 '23 14:08 fain182

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

hgraca avatar Aug 26 '23 21:08 hgraca

@fain182 I removed a duplicate assertion and added a few more to make sure all scenarios are covered.

hgraca avatar Aug 26 '23 21:08 hgraca

@fain182 I believe I fixed the issues, can you check the last commits, please?

hgraca avatar Sep 05 '23 11:09 hgraca

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.

codecov-commenter avatar Sep 10 '23 16:09 codecov-commenter

@hgraca i need this ;-;

Can we merge it?

d-cichon avatar Feb 27 '25 08:02 d-cichon

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

hgraca avatar Feb 27 '25 17:02 hgraca

@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

hgraca avatar Mar 09 '25 20:03 hgraca

@fain182 @micheleorselli it seems OK for me, any other opinions?

AlessandroMinoccheri avatar Mar 10 '25 16:03 AlessandroMinoccheri

I rebased and force pushed

hgraca avatar Mar 11 '25 20:03 hgraca