| 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.services.correction.status; | 5 library test.services.correction.status; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol_server.dart' hide Element; | 7 import 'package:analysis_server/src/protocol_server.dart' hide Element; |
| 8 import 'package:analysis_server/src/services/correction/source_range.dart'; | 8 import 'package:analysis_server/src/services/correction/source_range.dart'; |
| 9 import 'package:analysis_server/src/services/correction/status.dart'; | 9 import 'package:analysis_server/src/services/correction/status.dart'; |
| 10 import 'package:analysis_server/src/services/search/search_engine.dart'; | 10 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 expect(location.length, 7); | 36 expect(location.length, 7); |
| 37 expect(location.startLine, 1); | 37 expect(location.startLine, 1); |
| 38 expect(location.startColumn, 7); | 38 expect(location.startColumn, 7); |
| 39 } | 39 } |
| 40 | 40 |
| 41 test_createLocation_forMatch() async { | 41 test_createLocation_forMatch() async { |
| 42 await resolveTestUnit('class MyClass {}'); | 42 await resolveTestUnit('class MyClass {}'); |
| 43 Element element = findElement('MyClass'); | 43 Element element = findElement('MyClass'); |
| 44 SourceRange range = rangeElementName(element); | 44 SourceRange range = rangeElementName(element); |
| 45 SearchMatch match = new SearchMatchImpl( | 45 SearchMatch match = new SearchMatchImpl( |
| 46 context, | 46 element.context, |
| 47 element.library.source.uri.toString(), | 47 element.library.source.uri.toString(), |
| 48 element.source.uri.toString(), | 48 element.source.uri.toString(), |
| 49 null, | 49 null, |
| 50 range, | 50 range, |
| 51 true, | 51 true, |
| 52 false); | 52 false); |
| 53 // check | 53 // check |
| 54 Location location = newLocation_fromMatch(match); | 54 Location location = newLocation_fromMatch(match); |
| 55 expect(location.file, '/test.dart'); | 55 expect(location.file, '/test.dart'); |
| 56 expect(location.offset, range.offset); | 56 expect(location.offset, range.offset); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 expect(refactoringStatus.severity, RefactoringProblemSeverity.FATAL); | 226 expect(refactoringStatus.severity, RefactoringProblemSeverity.FATAL); |
| 227 expect(refactoringStatus.message, 'msg'); | 227 expect(refactoringStatus.message, 'msg'); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void test_newWarning() { | 230 void test_newWarning() { |
| 231 RefactoringStatus refactoringStatus = new RefactoringStatus.warning('msg'); | 231 RefactoringStatus refactoringStatus = new RefactoringStatus.warning('msg'); |
| 232 expect(refactoringStatus.severity, RefactoringProblemSeverity.WARNING); | 232 expect(refactoringStatus.severity, RefactoringProblemSeverity.WARNING); |
| 233 expect(refactoringStatus.message, 'msg'); | 233 expect(refactoringStatus.message, 'msg'); |
| 234 } | 234 } |
| 235 } | 235 } |
| OLD | NEW |