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/test.dart'; |
13 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
14 | 14 |
15 import '../analysis_abstract.dart'; | 15 import '../analysis_abstract.dart'; |
16 import '../utils.dart'; | |
17 | 16 |
18 main() { | 17 main() { |
19 initializeTestEnvironment(); | |
20 defineReflectiveSuite(() { | 18 defineReflectiveSuite(() { |
21 defineReflectiveTests(FixesTest); | 19 defineReflectiveTests(FixesTest); |
22 }); | 20 }); |
23 } | 21 } |
24 | 22 |
25 @reflectiveTest | 23 @reflectiveTest |
26 class FixesTest extends AbstractAnalysisTest { | 24 class FixesTest extends AbstractAnalysisTest { |
27 @override | 25 @override |
28 void setUp() { | 26 void setUp() { |
29 super.setUp(); | 27 super.setUp(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 return await _getFixes(offset); | 136 return await _getFixes(offset); |
139 } | 137 } |
140 | 138 |
141 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) { | 139 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) { |
142 AnalysisError error = fixes.error; | 140 AnalysisError error = fixes.error; |
143 expect(error.severity, AnalysisErrorSeverity.ERROR); | 141 expect(error.severity, AnalysisErrorSeverity.ERROR); |
144 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR); | 142 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR); |
145 expect(fixes.fixes, hasLength(1)); | 143 expect(fixes.fixes, hasLength(1)); |
146 } | 144 } |
147 } | 145 } |
OLD | NEW |