-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: improved query syntax #90
base: main
Are you sure you want to change the base?
Conversation
src/Uno.UI.RuntimeTests.Engine.Library/UI/UnitTestsControl.Filtering.cs
Outdated
Show resolved
Hide resolved
todo:
|
src/Uno.UI.RuntimeTests.Engine.Library/UI/UnitTestsControl.Filtering.cs
Outdated
Show resolved
Hide resolved
src/Uno.UI.RuntimeTests.Engine.Library/UI/UnitTestsControl.Filtering.cs
Outdated
Show resolved
Hide resolved
f2516c1
to
8ce91be
Compare
8ce91be
to
a3d454f
Compare
e4d8bb3
to
4b37deb
Compare
## Test runner (UnitTestsControl) filtering syntax | ||
- Search terms are separated by space. Multiple consecutive spaces are treated same as one. | ||
- Multiple search terms are chained with AND logic. | ||
- Search terms are case insensitive. | ||
- `-` can be used before any term for exclusion, effectively inverting the results. | ||
- Special tags can be used to match certain part of the test: // syntax: tag:term | ||
- `class` or `c` matches the class name | ||
- `method` or `m` matches the method name | ||
- `displayname` or `d` matches the display name in [DataRow] | ||
- Search term without a prefixing tag will match either of method name or class name. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Test runner (UnitTestsControl) filtering syntax | |
- Search terms are separated by space. Multiple consecutive spaces are treated same as one. | |
- Multiple search terms are chained with AND logic. | |
- Search terms are case insensitive. | |
- `-` can be used before any term for exclusion, effectively inverting the results. | |
- Special tags can be used to match certain part of the test: // syntax: tag:term | |
- `class` or `c` matches the class name | |
- `method` or `m` matches the method name | |
- `displayname` or `d` matches the display name in [DataRow] | |
- Search term without a prefixing tag will match either of method name or class name. | |
## Test runner (UnitTestsControl) filtering syntax | |
- Search terms are separated by space. Multiple consecutive spaces are treated the same as one. | |
- Multiple search terms are chained with AND logic. | |
- Search terms are case insensitive. | |
- `-` can be used before any term for exclusion, effectively inverting the results. | |
- Special tags can be used to match certain parts of the test: // syntax: tag:term | |
- `class` or `c` matches the class name | |
- `method` or `m` matches the method name | |
- `displayname` or `d` matches the display name in [DataRow] | |
- Search term without a prefixing tag will match either method name or class name. | |
internal static partial class StringExtensions | ||
{ | ||
/// <summary> | ||
/// Like <see cref="string.Split(char[])"/>, but allows exception to be made with a Regex pattern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Like <see cref="string.Split(char[])"/>, but allows exception to be made with a Regex pattern. | |
/// Like <see cref="string.Split(char[])"/>, but allows exceptions to be made with a Regex pattern. |
/// </summary> | ||
/// <param name="input"></param> | ||
/// <param name="separator"></param> | ||
/// <param name="ignoredPattern">segments matched by the regex will not be splited.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// <param name="ignoredPattern">segments matched by the regex will not be splited.</param> | |
/// <param name="ignoredPattern">segments matched by the regex will not be split.</param> |
}) | ||
.Where(x => filters?.MatchAllOnlyIfValuePresent(KnownTags.Parameters, x.Parameters) ?? true) | ||
.Where(x => filters?.MatchAllOnlyIf(KnownTags.AtIndex, x.IsDataSourced, y => MatchIndex(y, x.Index)) ?? true) | ||
// fixme: DisplayName will also matches parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// fixme: DisplayName will also matches parameters | |
// fixme: DisplayName will also match the parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixme: ?
/// </summary> | ||
/// <param name="tag"></param> | ||
/// <param name="value"></param> | ||
/// <returns>If all 'tag' filters matches the value, or true if the none filters are of 'tag'.</returns> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// <returns>If all 'tag' filters matches the value, or true if the none filters are of 'tag'.</returns> | |
/// <returns>If all 'tag' filters match the value, or true if the none filters are of 'tag'.</returns> |
GitHub Issue (If applicable): #89
PR Type
What kind of change does this PR introduce?
What is the new behavior?
new improved query syntax:
-
can be used before any term for exclusion, effectively filtering them outtag:match_text
class
orc
matches the class namemethod
orm
matches the method namedisplay_name
ord
matches the display name in[DataRow]
or[DynamicData]
full_name
orf
matches the full name of methodparams
orp
matches the parameters of[DataRow]
or[DynamicData]
(unrolled)at
or@
(without colon) matches the[DataRow]
or[DynamicData]
case at specific index (DynamicData: index within the source),
can be used to specify multiple potential matches (chained by OR logic)\"
to escape double-quote within a double-quoted match text:^
and$
to perform head or tail match, or both to perform full matchPR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information
Currently we can match multiple tests (by OR logics) via
;
delimiter. This is no longer supported in the new syntax.