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

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

Issue 2011183004: Precompute `IgnoreInfo` in Scanner. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« pkg/analyzer/lib/task/general.dart ('K') | « pkg/analyzer/lib/task/general.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 cddc662196cf276b146790d58a844fa4f802c13b..6bdaf323a66269c7bc619fac590a2a629be2efad 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -4464,18 +4464,35 @@ main(p1, p2, p3, p4) {
@reflectiveTest
class ScanDartTaskTest extends _AbstractDartTaskTest {
+ test_ignore_info() {
+ _performScanTask('''
+//ignore: error_code
+var x = '';
+foo(); // ignore: error_code_2
+bar(); //ignore: error_code, error_code_2
+''');
+
+ 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']));
+ }
+
test_perform_errors() {
_performScanTask('import "');
- expect(outputs, hasLength(3));
+ expect(outputs, hasLength(4));
expect(outputs[LINE_INFO], isNotNull);
+ expect(outputs[IGNORE_INFO], isNotNull);
scheglov 2016/05/27 18:05:47 Would be nice to test the computed IgnoreInfo here
Brian Wilkerson 2016/05/27 18:21:18 If the method in the task gets moved to the class,
pquitslund 2016/05/27 21:50:53 Done.
expect(outputs[SCAN_ERRORS], hasLength(1));
expect(outputs[TOKEN_STREAM], isNotNull);
}
test_perform_noErrors() {
_performScanTask('class A {}');
- expect(outputs, hasLength(3));
+ expect(outputs, hasLength(4));
expect(outputs[LINE_INFO], isNotNull);
+ expect(outputs[IGNORE_INFO], isNotNull);
expect(outputs[SCAN_ERRORS], hasLength(0));
expect(outputs[TOKEN_STREAM], isNotNull);
}
« pkg/analyzer/lib/task/general.dart ('K') | « pkg/analyzer/lib/task/general.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698