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

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: review_fixes 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
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.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..f71c6ffe729c60cdc85ee88ec6dfddbcc3813aaf 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -4464,20 +4464,41 @@ 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[SCAN_ERRORS], hasLength(1));
expect(outputs[TOKEN_STREAM], isNotNull);
+ IgnoreInfo ignoreInfo = outputs[IGNORE_INFO];
+ expect(ignoreInfo, isNotNull);
+ expect(ignoreInfo.hasIgnores, isFalse);
}
test_perform_noErrors() {
_performScanTask('class A {}');
- expect(outputs, hasLength(3));
+ expect(outputs, hasLength(4));
expect(outputs[LINE_INFO], isNotNull);
expect(outputs[SCAN_ERRORS], hasLength(0));
expect(outputs[TOKEN_STREAM], isNotNull);
+ IgnoreInfo ignoreInfo = outputs[IGNORE_INFO];
+ expect(ignoreInfo, isNotNull);
+ expect(ignoreInfo.hasIgnores, isFalse);
}
test_perform_script() {
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698