-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Allow integration test helpers to work on substrings instead of whole strings #160437
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
Allow integration test helpers to work on substrings instead of whole strings #160437
Conversation
dcharkes
left a comment
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.
=> This makes tests simpler as they don't have to know about the exact padding of progres bar etc. Those may be irrelevant for the purpose of the integration test and only complicate it.
The goal LGTM 👍
The implementation could be simpler, left comments.
packages/flutter_tools/test/integration.shard/transition_test_utils.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/integration.shard/transition_test_utils.dart
Outdated
Show resolved
Hide resolved
mkustermann
left a comment
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.
@dcharkes Please let me know if my comments make sense.
packages/flutter_tools/test/integration.shard/transition_test_utils.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/integration.shard/transition_test_utils.dart
Outdated
Show resolved
Hide resolved
a298fd4 to
d8d056a
Compare
d8d056a to
9b7e065
Compare
… strings The integration test framework that waits for transitions and (optionally) takes actions on transitions allows to match patterns. If one uses a RegExp pattern than the framework only checks whether a line contains the given RegExp pattern. If one uses a String pattern it matches it exactly. => We add a `Barrier.contains()` and `Multiple.contains()` that allow matching a line with if it contains the String (just like in RegExp) => This makes tests simpler as they don't have to know about the exact padding of progres bar etc. Those may be irrelevant for the purpose of the integration test and only complicate it.
9b7e065 to
15b4378
Compare
The integration test framework that waits for transitions and (optionally) takes actions on transitions allows to match patterns.
If one uses a RegExp pattern than the framework only checks whether a line contains the given RegExp pattern.
If one uses a String pattern it matches it exactly.
=> We add a
Barrier.contains()andMultiple.contains()that allow matching a line with if it contains the String (just like in RegExp)=> This makes tests simpler as they don't have to know about the exact padding of progres bar etc. Those may be irrelevant for the purpose of the integration test and only complicate it.