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

Side by Side Diff: pkg/analysis_server/test/edit/fix_test.dart

Issue 418203002: Implement more fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.edit.fix; 5 library test.edit.fix;
6 6
7 import 'package:analysis_server/src/computer/element.dart'; 7 import 'package:analysis_server/src/computer/element.dart';
8 import 'package:analysis_server/src/computer/error.dart'; 8 import 'package:analysis_server/src/computer/error.dart';
9 import 'package:analysis_server/src/edit/fix.dart'; 9 import 'package:analysis_server/src/edit/fix.dart';
10 import 'package:analysis_services/constants.dart'; 10 import 'package:analysis_services/constants.dart';
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void test_fromService() { 110 void test_fromService() {
111 verifyNoTestUnitErrors = false; 111 verifyNoTestUnitErrors = false;
112 resolveTestUnit(''' 112 resolveTestUnit('''
113 main() { 113 main() {
114 print(42) 114 print(42)
115 } 115 }
116 '''); 116 ''');
117 engine.AnalysisErrorInfo errors = context.getErrors(testSource); 117 engine.AnalysisErrorInfo errors = context.getErrors(testSource);
118 engine.AnalysisError engineError = errors.errors[0]; 118 engine.AnalysisError engineError = errors.errors[0];
119 List<services.Fix> servicesFixes = 119 List<services.Fix> servicesFixes =
120 services.computeFixes(searchEngine, testFile, testUnit, engineError); 120 services.computeFixes(searchEngine, testUnit, engineError);
121 AnalysisError error = 121 AnalysisError error =
122 new AnalysisError.fromEngine(errors.lineInfo, engineError); 122 new AnalysisError.fromEngine(errors.lineInfo, engineError);
123 ErrorFixes fixes = new ErrorFixes(error); 123 ErrorFixes fixes = new ErrorFixes(error);
124 servicesFixes.forEach((fix) => fixes.addFix(fix)); 124 servicesFixes.forEach((fix) => fixes.addFix(fix));
125 expect(fixes.toJson(), { 125 expect(fixes.toJson(), {
126 ERROR: { 126 ERROR: {
127 SEVERITY: 'ERROR', 127 SEVERITY: 'ERROR',
128 TYPE: 'SYNTACTIC_ERROR', 128 TYPE: 'SYNTACTIC_ERROR',
129 LOCATION: { 129 LOCATION: {
130 FILE: '/test.dart', 130 FILE: '/test.dart',
(...skipping 12 matching lines...) Expand all
143 OFFSET: 20, 143 OFFSET: 20,
144 LENGTH: 0, 144 LENGTH: 0,
145 REPLACEMENT: ';' 145 REPLACEMENT: ';'
146 }] 146 }]
147 }], 147 }],
148 LINKED_POSITION_GROUPS: [] 148 LINKED_POSITION_GROUPS: []
149 }] 149 }]
150 }); 150 });
151 } 151 }
152 } 152 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/edit/edit_domain.dart ('k') | pkg/analysis_services/lib/correction/change.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698