| 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'; |
| 11 import 'package:analysis_server/src/services/search/search_engine_internal.dart'
; | 11 import 'package:analysis_server/src/services/search/search_engine_internal.dart'
; |
| 12 import 'package:analyzer/dart/ast/ast.dart'; | 12 import 'package:analyzer/dart/ast/ast.dart'; |
| 13 import 'package:analyzer/dart/element/element.dart'; | 13 import 'package:analyzer/dart/element/element.dart'; |
| 14 import 'package:analyzer/src/generated/source.dart'; | 14 import 'package:analyzer/src/generated/source.dart'; |
| 15 import 'package:test/test.dart'; | 15 import 'package:test/test.dart'; |
| 16 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 16 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 17 | 17 |
| 18 import '../../abstract_single_unit.dart'; | 18 import '../../abstract_single_unit.dart'; |
| 19 | 19 |
| 20 main() { | 20 main() { |
| 21 defineReflectiveSuite(() { | 21 defineReflectiveSuite(() { |
| 22 defineReflectiveTests(RefactoringLocationTest); | 22 defineReflectiveTests(RefactoringLocationTest); |
| 23 defineReflectiveTests(RefactoringStatusTest); | 23 defineReflectiveTests(RefactoringStatusTest); |
| 24 }); | 24 }); |
| 25 } | 25 } |
| 26 | 26 |
| 27 @reflectiveTest | 27 @reflectiveTest |
| 28 class RefactoringLocationTest extends AbstractSingleUnitTest { | 28 class RefactoringLocationTest extends AbstractSingleUnitTest { |
| 29 @override |
| 30 bool get enableNewAnalysisDriver => false; |
| 31 |
| 29 test_createLocation_forElement() async { | 32 test_createLocation_forElement() async { |
| 30 await resolveTestUnit('class MyClass {}'); | 33 await resolveTestUnit('class MyClass {}'); |
| 31 Element element = findElement('MyClass'); | 34 Element element = findElement('MyClass'); |
| 32 // check | 35 // check |
| 33 Location location = newLocation_fromElement(element); | 36 Location location = newLocation_fromElement(element); |
| 34 expect(location.file, '/test.dart'); | 37 expect(location.file, '/test.dart'); |
| 35 expect(location.offset, 6); | 38 expect(location.offset, 6); |
| 36 expect(location.length, 7); | 39 expect(location.length, 7); |
| 37 expect(location.startLine, 1); | 40 expect(location.startLine, 1); |
| 38 expect(location.startColumn, 7); | 41 expect(location.startColumn, 7); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 expect(refactoringStatus.severity, RefactoringProblemSeverity.FATAL); | 229 expect(refactoringStatus.severity, RefactoringProblemSeverity.FATAL); |
| 227 expect(refactoringStatus.message, 'msg'); | 230 expect(refactoringStatus.message, 'msg'); |
| 228 } | 231 } |
| 229 | 232 |
| 230 void test_newWarning() { | 233 void test_newWarning() { |
| 231 RefactoringStatus refactoringStatus = new RefactoringStatus.warning('msg'); | 234 RefactoringStatus refactoringStatus = new RefactoringStatus.warning('msg'); |
| 232 expect(refactoringStatus.severity, RefactoringProblemSeverity.WARNING); | 235 expect(refactoringStatus.severity, RefactoringProblemSeverity.WARNING); |
| 233 expect(refactoringStatus.message, 'msg'); | 236 expect(refactoringStatus.message, 'msg'); |
| 234 } | 237 } |
| 235 } | 238 } |
| OLD | NEW |