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

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

Issue 1753083003: Fix issue where errors aren't reported for a new overlay (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rewritten, with a test Created 4 years, 10 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/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis/update_content_test.dart
diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart
index 3e096320dea437e4f782285ffe51403af26896fe..7ca1fba2bbf8f576bd956a6b7d73a711dc8f5d72 100644
--- a/pkg/analysis_server/test/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/analysis/update_content_test.dart
@@ -42,7 +42,8 @@ class UpdateContentTest extends AbstractAnalysisTest {
void processNotification(Notification notification) {
if (notification.event == ANALYSIS_ERRORS) {
var decoded = new AnalysisErrorsParams.fromNotification(notification);
- filesErrors[decoded.file] = decoded.errors;
+ _format(AnalysisError e) => "${e.location.startLine}: ${e.message}";
+ filesErrors[decoded.file] = decoded.errors.map(_format).toList();
}
if (notification.event == ANALYSIS_NAVIGATION) {
navigationCount++;
@@ -188,6 +189,29 @@ f() {}
expect(_getUserSources(context2), isEmpty);
}
+ test_overlay_addPreviouslyImported() async {
+ Folder project = resourceProvider.newFolder('/project');
+ handleSuccessfulRequest(
+ new AnalysisSetAnalysisRootsParams([project.path], []).toRequest('0'));
+
+ server.updateContent('1',
+ {'/project/main.dart': new AddContentOverlay('import "target.dart";')});
+ await server.onAnalysisComplete;
+ expect(filesErrors, {
+ '/project/main.dart': ["1: Target of URI does not exist: 'target.dart'"],
+ '/project/target.dart': []
+ });
+
+ server.updateContent('1',
+ {'/project/target.dart': new AddContentOverlay('import "none.dart";')});
+ await server.onAnalysisComplete;
+ expect(filesErrors, {
+ '/project/main.dart': ["1: Unused import"],
+ '/project/target.dart': ["1: Target of URI does not exist: 'none.dart'"],
+ '/project/none.dart': []
+ });
+ }
+
test_removeOverlay_incrementalChange() async {
createProject();
addTestFile('main() { print(1); }');
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698