| 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.assist; | 5 library test.services.correction.assist; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; | 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; |
| 10 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 10 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 11 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 11 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 12 import 'package:analysis_server/src/services/correction/assist.dart'; | 12 import 'package:analysis_server/src/services/correction/assist.dart'; |
| 13 import 'package:analyzer/src/generated/engine.dart'; | 13 import 'package:analyzer/src/generated/engine.dart'; |
| 14 import 'package:analyzer/src/generated/source.dart'; | 14 import 'package:analyzer/src/generated/source.dart'; |
| 15 import 'package:plugin/manager.dart'; | 15 import 'package:plugin/manager.dart'; |
| 16 import 'package:plugin/plugin.dart'; | 16 import 'package:plugin/plugin.dart'; |
| 17 import 'package:test/test.dart'; |
| 17 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 18 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 18 import 'package:unittest/unittest.dart'; | |
| 19 | 19 |
| 20 import '../../abstract_single_unit.dart'; | 20 import '../../abstract_single_unit.dart'; |
| 21 import '../../utils.dart'; | 21 import '../../utils.dart'; |
| 22 | 22 |
| 23 main() { | 23 main() { |
| 24 initializeTestEnvironment(); | 24 initializeTestEnvironment(); |
| 25 defineReflectiveTests(AssistProcessorTest); | 25 defineReflectiveSuite(() { |
| 26 defineReflectiveTests(AssistProcessorTest); |
| 27 }); |
| 26 } | 28 } |
| 27 | 29 |
| 28 @reflectiveTest | 30 @reflectiveTest |
| 29 class AssistProcessorTest extends AbstractSingleUnitTest { | 31 class AssistProcessorTest extends AbstractSingleUnitTest { |
| 30 int offset; | 32 int offset; |
| 31 int length; | 33 int length; |
| 32 | 34 |
| 33 ServerPlugin plugin; | 35 ServerPlugin plugin; |
| 34 Assist assist; | 36 Assist assist; |
| 35 SourceChange change; | 37 SourceChange change; |
| (...skipping 4147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4183 positions.add(new Position(testFile, offset)); | 4185 positions.add(new Position(testFile, offset)); |
| 4184 } | 4186 } |
| 4185 return positions; | 4187 return positions; |
| 4186 } | 4188 } |
| 4187 | 4189 |
| 4188 void _setStartEndSelection() { | 4190 void _setStartEndSelection() { |
| 4189 offset = findOffset('// start\n') + '// start\n'.length; | 4191 offset = findOffset('// start\n') + '// start\n'.length; |
| 4190 length = findOffset('// end') - offset; | 4192 length = findOffset('// end') - offset; |
| 4191 } | 4193 } |
| 4192 } | 4194 } |
| OLD | NEW |