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.fix; | 5 library test.services.correction.fix; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; | 9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; |
10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; | 10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; |
11 import 'package:analysis_server/plugin/protocol/protocol.dart' | 11 import 'package:analysis_server/plugin/protocol/protocol.dart' |
12 hide AnalysisError; | 12 hide AnalysisError; |
13 import 'package:analysis_server/src/services/correction/fix.dart'; | 13 import 'package:analysis_server/src/services/correction/fix.dart'; |
14 import 'package:analysis_server/src/services/correction/fix_internal.dart'; | 14 import 'package:analysis_server/src/services/correction/fix_internal.dart'; |
15 import 'package:analyzer/error/error.dart'; | 15 import 'package:analyzer/error/error.dart'; |
16 import 'package:analyzer/file_system/file_system.dart'; | 16 import 'package:analyzer/file_system/file_system.dart'; |
17 import 'package:analyzer/source/package_map_resolver.dart'; | 17 import 'package:analyzer/source/package_map_resolver.dart'; |
18 import 'package:analyzer/src/error/codes.dart'; | 18 import 'package:analyzer/src/error/codes.dart'; |
19 import 'package:analyzer/src/generated/parser.dart'; | 19 import 'package:analyzer/src/generated/parser.dart'; |
20 import 'package:analyzer/src/generated/source.dart'; | 20 import 'package:analyzer/src/generated/source.dart'; |
| 21 import 'package:test/test.dart'; |
21 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 22 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
22 import 'package:unittest/unittest.dart'; | |
23 | 23 |
24 import '../../abstract_context.dart'; | 24 import '../../abstract_context.dart'; |
25 import '../../abstract_single_unit.dart'; | 25 import '../../abstract_single_unit.dart'; |
26 import '../../utils.dart'; | 26 import '../../utils.dart'; |
27 | 27 |
28 main() { | 28 main() { |
29 initializeTestEnvironment(); | 29 initializeTestEnvironment(); |
30 defineReflectiveTests(FixProcessorTest); | 30 defineReflectiveSuite(() { |
31 defineReflectiveTests(LintFixTest); | 31 defineReflectiveTests(FixProcessorTest); |
| 32 defineReflectiveTests(LintFixTest); |
| 33 }); |
32 } | 34 } |
33 | 35 |
34 typedef bool AnalysisErrorFilter(AnalysisError error); | 36 typedef bool AnalysisErrorFilter(AnalysisError error); |
35 | 37 |
36 /** | 38 /** |
37 * Base class for fix processor tests. | 39 * Base class for fix processor tests. |
38 */ | 40 */ |
39 class BaseFixProcessorTest extends AbstractSingleUnitTest { | 41 class BaseFixProcessorTest extends AbstractSingleUnitTest { |
40 AnalysisErrorFilter errorFilter = (AnalysisError error) { | 42 AnalysisErrorFilter errorFilter = (AnalysisError error) { |
41 return error.errorCode != HintCode.UNUSED_CATCH_CLAUSE && | 43 return error.errorCode != HintCode.UNUSED_CATCH_CLAUSE && |
(...skipping 5417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5459 @override | 5461 @override |
5460 void t() { } | 5462 void t() { } |
5461 } | 5463 } |
5462 '''); | 5464 '''); |
5463 } | 5465 } |
5464 | 5466 |
5465 void verifyResult(String expectedResult) { | 5467 void verifyResult(String expectedResult) { |
5466 expect(resultCode, expectedResult); | 5468 expect(resultCode, expectedResult); |
5467 } | 5469 } |
5468 } | 5470 } |
OLD | NEW |