OLD | NEW |
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.domain.analysis; | 5 library test.domain.analysis; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
10 import 'package:analysis_server/src/computer/error.dart'; | 10 import 'package:analysis_server/src/computer/error.dart'; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 List<AnalysisError> errors = helper.getTestErrors(); | 211 List<AnalysisError> errors = helper.getTestErrors(); |
212 expect(errors, isEmpty); | 212 expect(errors, isEmpty); |
213 // Add the file to the cache | 213 // Add the file to the cache |
214 helper.sendContentChange({ | 214 helper.sendContentChange({ |
215 TYPE: ADD, | 215 TYPE: ADD, |
216 CONTENT: initialContent | 216 CONTENT: initialContent |
217 }); | 217 }); |
218 // update code | 218 // update code |
219 helper.sendContentChange({ | 219 helper.sendContentChange({ |
220 TYPE: CHANGE, | 220 TYPE: CHANGE, |
221 REPLACEMENT: 'lib', | 221 EDITS: [{ |
222 OFFSET: 'library '.length, | 222 REPLACEMENT: 'lib', |
223 LENGTH: 'A;'.length, | 223 OFFSET: 'library '.length, |
| 224 LENGTH: 'A;'.length |
| 225 }] |
224 }); | 226 }); |
225 // wait, there is an error | 227 // wait, there is an error |
226 return helper.waitForOperationsFinished().then((_) { | 228 return helper.waitForOperationsFinished().then((_) { |
227 List<AnalysisError> errors = helper.getTestErrors(); | 229 List<AnalysisError> errors = helper.getTestErrors(); |
228 expect(errors, hasLength(1)); | 230 expect(errors, hasLength(1)); |
229 }); | 231 }); |
230 }); | 232 }); |
231 }); | 233 }); |
232 | 234 |
233 test('change on disk, normal', () { | 235 test('change on disk, normal', () { |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 return waitForServerOperationsPerformed(server); | 630 return waitForServerOperationsPerformed(server); |
629 } | 631 } |
630 | 632 |
631 static String _getCodeString(code) { | 633 static String _getCodeString(code) { |
632 if (code is List<String>) { | 634 if (code is List<String>) { |
633 code = code.join('\n'); | 635 code = code.join('\n'); |
634 } | 636 } |
635 return code as String; | 637 return code as String; |
636 } | 638 } |
637 } | 639 } |
OLD | NEW |