Add matchesPattern support - #2519
Merged
Merged
Conversation
mikepizzo
reviewed
Oct 3, 2022
Fix broken test case
Fix misaligned spacing
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
gathogojr
requested review from
ElizabethOkerio,
KenitoInc,
habbes,
lisicase and
xuzhg
October 18, 2022 12:39
habbes
approved these changes
Oct 24, 2022
xuzhg
added a commit
that referenced
this pull request
Mar 9, 2026
…ction New Test Cases: FunctionCallBinderTests.cs - MatchesPatternFunctionBindsCorrectly: Tests binder layer binding, validates two string parameters, verifies Edm.Boolean return type FilterAndOrderByFunctionalTests.cs - MatchesPatternInFilterWithTheReturnType: Tests complete filter parsing pipeline with Name property, query: matchesPattern(Name, '^[A-Z][a-z]+dollar'), validates property access and pattern parameters FilterAndOrderByFunctionalTests.cs - MatchesPatternInFilterWithBooleanComparison: Tests matchesPattern in boolean expression, query: matchesPattern(Name, '[0-9]+') eq true Coverage: Binder layer, filter parser end-to-end, property access parameters, literal patterns, boolean expressions, return type validation. matchesPattern was added in commit 023bede (PR #2519) by Avi Levin on Oct 24, 2022.
2 tasks
xuzhg
added a commit
that referenced
this pull request
Mar 9, 2026
…ction New Test Cases: FunctionCallBinderTests.cs - MatchesPatternFunctionBindsCorrectly: Tests binder layer with Name property access, validates two parameters (property + pattern), verifies Edm.Boolean return type with email validation regex FilterAndOrderByFunctionalTests.cs - MatchesPatternInFilterWithTheReturnType: Tests complete filter parsing pipeline, query: matchesPattern(Name, '^[A-Z][a-z]+'), validates property access and pattern parameters FilterAndOrderByFunctionalTests.cs - MatchesPatternInFilterWithBooleanComparison: Tests matchesPattern in boolean expression, query: matchesPattern(Name, '[0-9]+') eq true, validates function in binary operator context Coverage: Binder layer, filter parser end-to-end, property access parameters, literal patterns, boolean expressions, return type validation. matchesPattern was added in commit 023bede (PR #2519)
xuzhg
added a commit
that referenced
this pull request
Mar 9, 2026
…ction (#3499) New Test Cases: FunctionCallBinderTests.cs - MatchesPatternFunctionBindsCorrectly: Tests binder layer with Name property access, validates two parameters (property + pattern), verifies Edm.Boolean return type with email validation regex FilterAndOrderByFunctionalTests.cs - MatchesPatternInFilterWithTheReturnType: Tests complete filter parsing pipeline, query: matchesPattern(Name, '^[A-Z][a-z]+'), validates property access and pattern parameters FilterAndOrderByFunctionalTests.cs - MatchesPatternInFilterWithBooleanComparison: Tests matchesPattern in boolean expression, query: matchesPattern(Name, '[0-9]+') eq true, validates function in binary operator context Coverage: Binder layer, filter parser end-to-end, property access parameters, literal patterns, boolean expressions, return type validation. matchesPattern was added in commit 023bede (PR #2519)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
This pull request fixes #1901.
Description
Adds support for the
matchesPatternfunction introduced in OData v4. In addition to being added as a supported function to the raw parser, it is mapped in .NET toRegex.IsMatch(input, pattern, RegexOptions.ECMAScript).The basic methodology was to look for any C# file in the repository that handled all of the string predicates (
startswith,endswith, etc.) and addedmatchesPatternto that set. There was at least one legacy provider with no support for e.g.contains; that provider was unmodified.As part of this work, the case-insensitivity logic had to be changed to account for
matchesPatternbeing the first OData function whose canonical name is mixed-case.Checklist
Unable to cast COM object of type 'AstoriaUnitTests.Tests.JScriptEngine'...)