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

More patterns don't match correctly. #19

Closed
pufmat opened this issue Mar 12, 2024 · 2 comments
Closed

More patterns don't match correctly. #19

pufmat opened this issue Mar 12, 2024 · 2 comments

Comments

@pufmat
Copy link
Contributor

pufmat commented Mar 12, 2024

Describe the bug
Pattern *1? should not match 121.
Pattern *12 should not match 122.
Pattern *121 should match 12121.

To Reproduce
Steps to reproduce the behavior:

assert!(WildMatch::new("*1?").matches("121") == false);
assert!(WildMatch::new("*12").matches("122") == false);
assert!(WildMatch::new("*121").matches("12121") == true);

Expected behavior
Assertions should pass.

Additional context
rustc 1.75.0 (82e1608df 2023-12-21)

@becheran
Copy link
Owner

Meanwhile I have a random input test written which also fails on some inputs. I am working on a solution

becheran pushed a commit that referenced this issue Mar 13, 2024
@becheran
Copy link
Owner

I fixed the issues including a unit test which generates many random patterns to hopefuly also catch issues if there are still some.

Please upgrade to version 2.3.2

I had to re-run the benchmarks and the matching performance decreased by the factor two which is kind of expected since I now iterate over the input twice since I create a vec of chars for precise indexing. I don't have a solution for that yet, but will close this issue and open another one to improve performance further if that is even possible. I don't know yet.

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

No branches or pull requests

2 participants