Skip to content
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 pattern match #404

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

hgraca
Copy link
Contributor

@hgraca hgraca commented Aug 7, 2023

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

I am reverting the change that introduced the bug.

@fain182 fain182 self-assigned this Aug 22, 2023
@fain182
Copy link
Collaborator

fain182 commented Aug 26, 2023

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 🙂

@hgraca
Copy link
Contributor Author

hgraca commented Aug 26, 2023

@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
Copy link
Contributor Author

hgraca commented Aug 26, 2023

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

@hgraca
Copy link
Contributor Author

hgraca commented Sep 5, 2023

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

@codecov-commenter
Copy link

Codecov Report

Merging #404 (7f6ae0d) into main (976c200) will decrease coverage by 0.02%.
Report is 4 commits behind head on main.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@             Coverage Diff              @@
##               main     #404      +/-   ##
============================================
- Coverage     94.33%   94.31%   -0.02%     
+ Complexity      571      570       -1     
============================================
  Files            67       67              
  Lines          1500     1495       -5     
============================================
- Hits           1415     1410       -5     
  Misses           85       85              
Files Changed Coverage Δ
src/Analyzer/PatternString.php 100.00% <100.00%> (ø)
...ession/ForClasses/ResideInOneOfTheseNamespaces.php 100.00% <100.00%> (ø)

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.

None yet

3 participants