[MOD-9547] Implement wildcard matching, as a preliminary step towards wildcard trie iterators.#6000
[MOD-9547] Implement wildcard matching, as a preliminary step towards wildcard trie iterators.#6000LukeMathWalker merged 11 commits intomasterfrom
Conversation
abe9a3e to
ea7aaed
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6000 +/- ##
==========================================
+ Coverage 87.44% 87.48% +0.03%
==========================================
Files 217 219 +2
Lines 39359 39505 +146
Branches 2634 2780 +146
==========================================
+ Hits 34419 34559 +140
- Misses 4931 4937 +6
Partials 9 9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
391f1f2 to
5d4c6b0
Compare
DarthB
left a comment
There was a problem hiding this comment.
My main concern is the missing handlng of ' as escape character. Besides that it look good overall.
I wonder why you decided for intgration tests, instead of unit tests? Even with proptests this feels lightweight.
|
Just realized, I have an untracked |
In this case, all functions are public, so there is no difference between unit tests and integration tests. |
cb207cb to
8fa1035
Compare
| if wc_cf.is_match(&key) { | ||
| matches!(&input.pattern, [&key]) | ||
| } | ||
| } |
There was a problem hiding this comment.
maybe there a nice way to check the no_match cases?
no_match -> cloudflare no match
… wildcard trie iterators.
without losing the short-circuiting optimization for patterns with a known expected length. Microbenchmarks have been added to confirm that we don't compromise performance.
cd463c5 to
75d05c3
Compare
BenGoldberger
left a comment
There was a problem hiding this comment.
overall looks good, there are a few comments.
… wildcard trie iterators. (#6000) * [MOD-8973] Implement wildcard matching, as a preliminary step towards wildcard trie iterators. * Use a different slicing style * Add proptest-regressions to gitignore * Boost parse documentation to clarify how escaping and simplifications work * Clarify comment * Remove duplicated test case * Implement Display and Debug for all public types * Combine `matches` and `matches_fixed_len` into a single function, without losing the short-circuiting optimization for patterns with a known expected length. Microbenchmarks have been added to confirm that we don't compromise performance. * When Cloudflare doesn't match, we don't match either. * Don't spell check the benchmarks * Test the formatted representations
… wildcard trie iterators. (#6000) * [MOD-8973] Implement wildcard matching, as a preliminary step towards wildcard trie iterators. * Use a different slicing style * Add proptest-regressions to gitignore * Boost parse documentation to clarify how escaping and simplifications work * Clarify comment * Remove duplicated test case * Implement Display and Debug for all public types * Combine `matches` and `matches_fixed_len` into a single function, without losing the short-circuiting optimization for patterns with a known expected length. Microbenchmarks have been added to confirm that we don't compromise performance. * When Cloudflare doesn't match, we don't match either. * Don't spell check the benchmarks * Test the formatted representations
… wildcard trie iterators. (#6000) * [MOD-8973] Implement wildcard matching, as a preliminary step towards wildcard trie iterators. * Use a different slicing style * Add proptest-regressions to gitignore * Boost parse documentation to clarify how escaping and simplifications work * Clarify comment * Remove duplicated test case * Implement Display and Debug for all public types * Combine `matches` and `matches_fixed_len` into a single function, without losing the short-circuiting optimization for patterns with a known expected length. Microbenchmarks have been added to confirm that we don't compromise performance. * When Cloudflare doesn't match, we don't match either. * Don't spell check the benchmarks * Test the formatted representations
Describe the changes in the pull request
This PR covers wildcard matching. It is the first of a series of PRs aimed at breaking #5928 down into smaller (and easier to review) chunks.
Wildcard matching is implemented as a standalone crate, named
wildcard.It mirrors the functionality provided by
src/wildcard.*, restricted toc_char(for now). The test suite intests/ctests/test_wildcard.chas been ported over to Rust too, alongside new test cases (e.g. property-based tests).Mark if applicable