-
-
Notifications
You must be signed in to change notification settings - Fork 111
docs: fix incorrect OR operator syntax in test-filters documentation #4582
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
Conversation
The previous example `(/*/*/Class1/*)|(/*/*/Class2/*)` is invalid because Microsoft.Testing.Platform's TreeNodeFilter does not allow OR operations across full paths - the `/` character cannot appear within expressions being combined with operators. The correct syntax uses OR within a single path segment: `/*/*/(Class1)|(Class2)/*` Fixes #4580
SummaryFixes incorrect OR operator syntax in test-filters.md documentation that causes TreeNodeFilter validation errors. Critical IssuesIncomplete Fix: This PR fixes one instance but leaves other incorrect examples in the codebase:
Note: These inconsistencies will confuse users who find the incorrect examples in other documentation files. SuggestionsConsider expanding this PR to fix all instances of incorrect OR syntax across the documentation to prevent confusion. Verdict |
Summary
The documentation showed an invalid OR operator syntax that causes errors with Microsoft.Testing.Platform's TreeNodeFilter.
Invalid syntax (old):
This throws:
A filter '/.*/.*/Class1/.*' should not contain a '/' characterValid syntax (new):
Root Cause
Microsoft.Testing.Platform's TreeNodeFilter validates that expressions being combined with operators (
|,&) cannot contain the/path separator character. OR operations must occur within a single path segment, not across full paths.From the TreeNodeFilter source:
Test plan
dotnet run -- --treenode-filter "/*/*/(Class1)|(Class2)/*"