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.edit.fixes; | 5 library test.edit.fixes; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/edit/edit_domain.dart'; | 10 import 'package:analysis_server/src/edit/edit_domain.dart'; |
11 import 'package:plugin/manager.dart'; | 11 import 'package:plugin/manager.dart'; |
| 12 import 'package:test/test.dart'; |
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
13 import 'package:unittest/unittest.dart' hide ERROR; | |
14 | 14 |
15 import '../analysis_abstract.dart'; | 15 import '../analysis_abstract.dart'; |
16 import '../utils.dart'; | 16 import '../utils.dart'; |
17 | 17 |
18 main() { | 18 main() { |
19 initializeTestEnvironment(); | 19 initializeTestEnvironment(); |
20 defineReflectiveTests(FixesTest); | 20 defineReflectiveSuite(() { |
| 21 defineReflectiveTests(FixesTest); |
| 22 }); |
21 } | 23 } |
22 | 24 |
23 @reflectiveTest | 25 @reflectiveTest |
24 class FixesTest extends AbstractAnalysisTest { | 26 class FixesTest extends AbstractAnalysisTest { |
25 @override | 27 @override |
26 void setUp() { | 28 void setUp() { |
27 super.setUp(); | 29 super.setUp(); |
28 ExtensionManager manager = new ExtensionManager(); | 30 ExtensionManager manager = new ExtensionManager(); |
29 manager.processPlugins([server.serverPlugin]); | 31 manager.processPlugins([server.serverPlugin]); |
30 handler = new EditDomainHandler(server); | 32 handler = new EditDomainHandler(server); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 return await _getFixes(offset); | 138 return await _getFixes(offset); |
137 } | 139 } |
138 | 140 |
139 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) { | 141 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) { |
140 AnalysisError error = fixes.error; | 142 AnalysisError error = fixes.error; |
141 expect(error.severity, AnalysisErrorSeverity.ERROR); | 143 expect(error.severity, AnalysisErrorSeverity.ERROR); |
142 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR); | 144 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR); |
143 expect(fixes.fixes, hasLength(1)); | 145 expect(fixes.fixes, hasLength(1)); |
144 } | 146 } |
145 } | 147 } |
OLD | NEW |