@@ -418,8 +418,8 @@ Future<void> verifyNoSyncAsyncStar(String workingDirectory, {int minimumMatches
418
418
}
419
419
}
420
420
421
- final RegExp _findGoldenTestPattern = RegExp (r'matchesGoldenFile\(' );
422
- final RegExp _findGoldenDefinitionPattern = RegExp (r'matchesGoldenFile\(Object' );
421
+ final RegExp _findGoldenTestPattern = RegExp (r'( matchesGoldenFile|expectFlakyGolden) \(' );
422
+ final RegExp _findGoldenDefinitionPattern = RegExp (r'( matchesGoldenFile|expectFlakyGolden) \(Object' );
423
423
final RegExp _leadingComment = RegExp (r'//' );
424
424
final RegExp _goldenTagPattern1 = RegExp (r'@Tags\(' );
425
425
final RegExp _goldenTagPattern2 = RegExp (r"'reduced-test-set'" );
@@ -431,8 +431,17 @@ const String _ignoreGoldenTag = '// flutter_ignore: golden_tag (see analyze.dart
431
431
const String _ignoreGoldenTagForFile = '// flutter_ignore_for_file: golden_tag (see analyze.dart)' ;
432
432
433
433
Future <void > verifyGoldenTags (String workingDirectory, { int minimumMatches = 2000 }) async {
434
+ // Skip flutter_goldens/lib because this library uses `matchesGoldenFile`
435
+ // but is not itself a test that needs tags.
436
+ final String flutterGoldensPackageLib = path.join (flutterPackages, 'flutter_goldens' , 'lib' );
437
+ bool isWithinFlutterGoldenLib (File file) {
438
+ return path.isWithin (flutterGoldensPackageLib, file.path);
439
+ }
440
+
434
441
final List <String > errors = < String > [];
435
- await for (final File file in _allFiles (workingDirectory, 'dart' , minimumMatches: minimumMatches)) {
442
+ final Stream <File > allTestFiles = _allFiles (workingDirectory, 'dart' , minimumMatches: minimumMatches)
443
+ .where ((File file) => ! isWithinFlutterGoldenLib (file));
444
+ await for (final File file in allTestFiles) {
436
445
bool needsTag = false ;
437
446
bool hasTagNotation = false ;
438
447
bool hasReducedTag = false ;
0 commit comments