Skip to content

Commit

Permalink
Update matchesGoldenFile documentation reference to goldenFileCompara…
Browse files Browse the repository at this point in the history
…tor (#150343)

Updates the documentation for the [`matchesGoldenFile`](https://api.flutter.dev/flutter/flutter_test/matchesGoldenFile.html) comparator. 

The documentation currently references the abstract class [`GoldenFileComparator`](https://api.flutter.dev/flutter/flutter_test/GoldenFileComparator-class.html) "as the backend for this matcher", however I believe it should instead reference to [`goldenFileComparator`](https://api.flutter.dev/flutter/flutter_test/goldenFileComparator.html) that also clearly states in its documentation that it is "This comparator is used as the backend for [matchesGoldenFile](https://api.flutter.dev/flutter/flutter_test/matchesGoldenFile.html).".

Knowledge about [`goldenFileComparator`](https://api.flutter.dev/flutter/flutter_test/goldenFileComparator.html) is useful for Flutter developers since it is required when trying to set their own custom comparator, and there is currently no reference to it within the [`matchesGoldenFile`](https://api.flutter.dev/flutter/flutter_test/matchesGoldenFile.html). The abstract class [`GoldenFileComparator`](https://api.flutter.dev/flutter/flutter_test/GoldenFileComparator-class.html) is still being referenced within the second suggestion.

#76337, precisely flutter/flutter#76337 (comment)
  • Loading branch information
alestiago authored Jun 17, 2024
1 parent e0ddad0 commit a97a9b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/flutter_test/lib/src/matchers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ Matcher coversSameAreaAs(Path expectedPath, { required Rect areaToCompare, int s
///
/// See also:
///
/// * [GoldenFileComparator], which acts as the backend for this matcher.
/// * [goldenFileComparator], which acts as the backend for this matcher.
/// * [LocalFileComparator], which is the default [GoldenFileComparator]
/// implementation for `flutter test`.
/// * [matchesReferenceImage], which should be used instead if you want to
Expand Down

0 comments on commit a97a9b3

Please sign in to comment.