-
Notifications
You must be signed in to change notification settings - Fork 28.8k
Replace [FinderBase] with [Finder] in the documentation of Matchers #168279
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
base: master
Are you sure you want to change the base?
Conversation
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.
Isn't it more accurate to say FinderBase instead of Finder? Something like findsNothing could be used with SemanticsFinder, which is a FinderBase and not a Finder.
Edit: In your example in the issue #168230, you compare findsNothing with findsOneWidget, but findsOneWidget should operate only on Finders, so I think that is correct as-is.
I cannot understand you. Both FindsNothing and FindsOneWidget are instances of the same class: _FindsCountMatcher, so if something should work with one, it should work with the other, and if something should not work with one, it should not work with the other. |
Yes please go ahead and update the PR and I will take another look. Thank you! |
I did replace [Finder] with [FinderBase] in the doc comments of Matchers. |
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.
I think these are all correct as-is, unless I missed one. These all seem to operate on widgets and therefore it's more accurate to say Finder and not FinderBase.
I think we can probably close this PR and close #168230, unless there is a specific mismatch that you see in the use of Finder vs. FinderBase.
/// Asserts that the [Finder] locates at least one widget in the widget tree. | ||
/// Asserts that the [FinderBase] locates at least one widget in the widget tree. |
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.
I think this was correct as-is. findsWidgets deals with widgets and so does Finder.
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.
findsWidgets is an instance of the _FindsCountMatcher class.
This is the signature of the matches() method of _FindsCountMatcher:
bool matches(covariant FinderBase<dynamic> finder, Map<dynamic, dynamic> matchState)
As you can see, it takes a FinderBase, not a Finder, as its first argument. So I think that FinderBase is the correct type that should be used in this doc 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.
Ah ok you're right, they do all operate on FinderBase even when they have "widgets" in the name. I even see this below for findsOneWidget:
This is equivalent to the preferred [findsOne] method.
Indeed findsOne and findsOneWidget are identical.
/// Asserts that the [Finder] locates a single widget that has at | ||
/// Asserts that the [FinderBase] locates a single widget that has at |
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 one looks like it actually should be Finder right?
bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) { |
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.
Ok. This should be Finder.
/// Asserts that the [Finder] locates at least one widget in the widget tree. | ||
/// Asserts that the [FinderBase] locates at least one widget in the widget tree. |
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.
Ah ok you're right, they do all operate on FinderBase even when they have "widgets" in the name. I even see this below for findsOneWidget:
This is equivalent to the preferred [findsOne] method.
Indeed findsOne and findsOneWidget are identical.
/// Asserts that the [Finder] locates a single widget that has no | ||
/// Asserts that the [FinderBase] locates a single widget that has no |
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.
Also this one should stay Finder.
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.
Ok. This should stay Finder.
/// Asserts that the [Finder] locates a single widget that has no | ||
/// Asserts that the [FinderBase] locates a single widget that has no |
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.
Should stay Finder.
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.
Ok. This should stay Finder.
/// Asserts that a [Finder], [Future<ui.Image>], or [ui.Image] matches the | ||
/// Asserts that a [FinderBase], [Future<ui.Image>], or [ui.Image] matches the | ||
/// golden image file identified by [key], with an optional [version] number. | ||
/// | ||
/// For the case of a [Finder], the [Finder] must match exactly one widget and | ||
/// For the case of a [FinderBase], the [FinderBase] must match exactly one widget and |
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.
Looks like it's a Finder:
} else if (item is Finder) { |
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.
Ok. This should stay Finder.
/// Asserts that a [Finder] locates a single object whose root RenderObject is | ||
/// Asserts that a [FinderBase] locates a single object whose root RenderObject is |
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.
Finder:
bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) { |
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.
Ok. This should stay Finder.
/// Asserts that a [Finder] locates a single object whose root RenderObject | ||
/// Asserts that a [FinderBase] locates a single object whose root RenderObject |
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.
Finder:
bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) { |
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.
Ok. This should stay Finder.
/// Asserts that a [Finder] locates a single object whose root RenderObject | ||
/// Asserts that a [FinderBase] locates a single object whose root RenderObject |
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.
Finder:
bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) { |
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.
Ok. This should stay Finder.
/// Asserts that a [Finder] locates a single object whose root RenderObject | ||
/// Asserts that a [FinderBase] locates a single object whose root RenderObject |
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.
Finder:
bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) { |
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.
Ok, Finder.
/// Asserts that a [Finder] locates a single object whose root RenderObject | ||
/// Asserts that a [FinderBase] locates a single object whose root RenderObject |
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.
Finder:
bool matches(covariant Finder finder, Map<dynamic, dynamic> matchState) { |
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.
Ok, Finder.
I have updated the pull request based on the last investigation. |
@justinmc Is there any additional needed requirements to merge this PR? |
Replace [FinderBase] with [Finder] in the doc comments of Matchers.
This is my try to fix #168230