Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2154)

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 2888953002: Analyzer: add ignore_for_file comment that ignores a type of problem for the whole file; add tests. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/generated/error_suppression_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 2a2f84d5136987ce3e9b0776146b8af43d9df119..9ea09a084c9d3b9dd63e0f9b0857b9aece2894c4 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -4360,16 +4360,20 @@ class ScanDartTaskTest extends _AbstractDartTaskTest {
test_ignore_info() {
_performScanTask('''
//ignore: error_code
+//ignore_for_file: error_code
var x = '';
foo(); // ignore: error_code_2
bar(); //ignore: error_code, error_code_2
+// ignore_for_file: error_code_2, error_code_3
''');
IgnoreInfo info = outputs[IGNORE_INFO];
expect(info.ignores.keys, hasLength(3));
expect(info.ignores[1].first, 'error_code');
- expect(info.ignores[3].first, 'error_code_2');
- expect(info.ignores[4], unorderedEquals(['error_code', 'error_code_2']));
+ expect(info.ignores[4].first, 'error_code_2');
+ expect(info.ignores[5], unorderedEquals(['error_code', 'error_code_2']));
+ expect(info.ignoreForFiles,
+ unorderedEquals(['error_code', 'error_code_2', 'error_code_3']));
}
test_perform_errors() {
« no previous file with comments | « pkg/analyzer/test/generated/error_suppression_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698