Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test progress
  • Loading branch information
Piinks committed Nov 4, 2022
commit 72b69c0e580c48cd5f7e8d50b2cce8a66a24e04e
2 changes: 1 addition & 1 deletion dev/bots/analyze.dart
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ Future<void> verifyNoSyncAsyncStar(String workingDirectory, {int minimumMatches
}

final RegExp _findGoldenTestPattern = RegExp(r'(matchesGoldenFile|expectFlakyGolden)\(');
final RegExp _findGoldenDefinitionPattern = RegExp(r'matchesGoldenFile\(Object');
final RegExp _findGoldenDefinitionPattern = RegExp(r'(matchesGoldenFile|expectFlakyGolden)\(Object');
final RegExp _leadingComment = RegExp(r'//');
final RegExp _goldenTagPattern1 = RegExp(r'@Tags\(');
final RegExp _goldenTagPattern2 = RegExp(r"'reduced-test-set'");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// The reduced test set tag is missing. This should fail analysis.
@Tags(<String>['some-other-tag'])

import 'package:test/test.dart';

import 'golden_class.dart';

void main() {
expectFlakyGolden('finder', 'missing_tag.png');
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// The tag is missing. This should fail analysis.

import 'golden_class.dart';

void main() {
expectFlakyGolden('key', 'missing_tag.png');
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
void matchesGoldenFile(Object key) {
return;
}

void expectFlakyGolden(Object key, String string){
return;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
/// ```
/// {@end-tool}
///
/// expectFlakyGolden(a, b)

// Other comments
// matchesGoldenFile('comment.png');
// expectFlakyGolden(a, b);

String literal = 'matchesGoldenFile()'; // flutter_ignore: golden_tag (see analyze.dart)
String flakyLiteral = 'expectFlakyGolden';
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ import 'golden_class.dart';

void main() {
matchesGoldenFile('missing_tag.png');
expectFlakyGolden('key', 'String');
}
2 changes: 2 additions & 0 deletions dev/bots/test/analyze_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ void main() {
'at the top of the file before import statements.';
const String missingTag = "Files containing golden tests must be tagged with 'reduced-test-set'.";
final List<String> lines = <String>[
'║ test/analyze-test-input/root/packages/foo/flaky_golden_no_tag.dart: $noTag',
'║ test/analyze-test-input/root/packages/foo/golden_missing_tag.dart: $missingTag',
'║ test/analyze-test-input/root/packages/foo/flaky_golden_missing_tag.dart: $missingTag',
'║ test/analyze-test-input/root/packages/foo/golden_no_tag.dart: $noTag',
]
.map((String line) => line.replaceAll('/', Platform.isWindows ? r'\' : '/'))
Expand Down
Empty file.
Loading