test: Add comprehensive test coverage for matchesPattern built-in function - #3499
Merged
Merged
Conversation
Member
Author
|
/AzurePipelines run |
There was a problem hiding this comment.
Pull request overview
Adds additional unit and functional tests to validate matchesPattern binding and end-to-end filter parsing behavior in OData URI parsing, expanding coverage since the original feature addition.
Changes:
- Add a new
FunctionCallBinderTeststest for bindingmatchesPattern. - Add two new
FilterAndOrderByFunctionalTestscases covering return type and boolean comparison scenarios formatchesPattern.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/UnitTests/Microsoft.OData.Core.Tests/UriParser/Binders/FunctionCallBinderTests.cs | Adds a binder-layer unit test intended to validate matchesPattern binding and parameter typing. |
| test/UnitTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/FilterAndOrderByFunctionalTests.cs | Adds end-to-end filter parsing tests for matchesPattern and boolean comparison usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…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
force-pushed
the
feature/add-matchespattern-filter-tests
branch
from
March 9, 2026 18:33
a7a7ea1 to
77f237c
Compare
Member
Author
|
/AzurePipelines run |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
'MatchesPattern' function call was added at #2519.
This PR is to add more test cases to verify the changes.
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.
Issues
This pull request fixes #xxx.
Description
Briefly describe the changes of this pull request.
Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.
Repository notes
Team members can start a CI build by adding a comment with the text
/AzurePipelines runto a PR. A bot may respond indicating that there is no pipeline associated with the pull request. This can be ignored if the build is triggered.Team members should not trigger a build this way for pull requests coming from forked repositories. They should instead trigger the build manually by setting the "branch" to
refs/pull/{prId}/mergewhere{prId}is the ID of the PR.