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

Unified Diff: pkg/analysis_server/test/analysis/notification_errors_test.dart

Issue 1378503003: Suppress scanner errors for non-existent URIs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Review fix. Created 5 years, 2 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 | « no previous file | pkg/analysis_server/test/analysis/test_all.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis/notification_errors_test.dart
diff --git a/pkg/analysis_server/test/analysis/notification_errors_test.dart b/pkg/analysis_server/test/analysis/notification_errors_test.dart
index e03a3807d3bf99e97d2701916d6f26782f2b85c6..aa841e3d47fcbba7a0de86648202d989c3afc68e 100644
--- a/pkg/analysis_server/test/analysis/notification_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_errors_test.dart
@@ -7,6 +7,7 @@ library test.analysis.notification_errors;
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/domain_analysis.dart';
import 'package:analysis_server/src/protocol.dart';
+import 'package:analyzer/src/generated/engine.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
@@ -35,6 +36,24 @@ class NotificationErrorsTest extends AbstractAnalysisTest {
server.handlers = [new AnalysisDomainHandler(server),];
}
+ test_importError() {
+ createProject();
+
+ addTestFile('''
+import 'does_not_exist.dart';
+''');
+ return waitForTasksFinished().then((_) {
+ List<AnalysisError> errors = filesErrors[testFile];
+ // Verify that we are generating only 1 error for the bad URI.
+ // https://github.com/dart-lang/sdk/issues/23754
+ expect(errors, hasLength(1));
+ AnalysisError error = errors[0];
+ expect(error.severity, AnalysisErrorSeverity.ERROR);
+ expect(error.type, AnalysisErrorType.COMPILE_TIME_ERROR);
+ expect(error.message, startsWith('Target of URI does not exist'));
+ });
+ }
+
test_notInAnalysisRoot() {
createProject();
String otherFile = '/other.dart';
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698