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/src/domain_analysis.dart'; | 9 import 'package:analysis_server/src/domain_analysis.dart'; |
10 import 'package:analysis_server/src/edit/edit_domain.dart'; | 10 import 'package:analysis_server/src/edit/edit_domain.dart'; |
11 import 'package:analysis_server/src/protocol.dart'; | 11 import 'package:analysis_server/src/protocol.dart'; |
12 import 'package:plugin/manager.dart'; | 12 import 'package:plugin/manager.dart'; |
13 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
14 import 'package:unittest/unittest.dart' hide ERROR; | 14 import 'package:unittest/unittest.dart' hide ERROR; |
15 | 15 |
16 import '../analysis_abstract.dart'; | 16 import '../analysis_abstract.dart'; |
17 import '../mocks.dart'; | 17 import '../mocks.dart'; |
| 18 import '../utils.dart'; |
18 | 19 |
19 main() { | 20 main() { |
20 groupSep = ' | '; | 21 initializeTestEnvironment(); |
21 defineReflectiveTests(FixesTest); | 22 defineReflectiveTests(FixesTest); |
22 } | 23 } |
23 | 24 |
24 @reflectiveTest | 25 @reflectiveTest |
25 class FixesTest extends AbstractAnalysisTest { | 26 class FixesTest extends AbstractAnalysisTest { |
26 @override | 27 @override |
27 void setUp() { | 28 void setUp() { |
28 super.setUp(); | 29 super.setUp(); |
29 createProject(); | 30 createProject(); |
30 ExtensionManager manager = new ExtensionManager(); | 31 ExtensionManager manager = new ExtensionManager(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 return _getFixes(offset); | 109 return _getFixes(offset); |
109 } | 110 } |
110 | 111 |
111 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) { | 112 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) { |
112 AnalysisError error = fixes.error; | 113 AnalysisError error = fixes.error; |
113 expect(error.severity, AnalysisErrorSeverity.ERROR); | 114 expect(error.severity, AnalysisErrorSeverity.ERROR); |
114 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR); | 115 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR); |
115 expect(fixes.fixes, hasLength(1)); | 116 expect(fixes.fixes, hasLength(1)); |
116 } | 117 } |
117 } | 118 } |
OLD | NEW |