| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.test.source.error_processor; | 5 library analyzer.test.source.error_processor; |
| 6 | 6 |
| 7 import 'package:analyzer/source/analysis_options_provider.dart'; | 7 import 'package:analyzer/source/analysis_options_provider.dart'; |
| 8 import 'package:analyzer/source/error_processor.dart'; | 8 import 'package:analyzer/source/error_processor.dart'; |
| 9 import 'package:analyzer/src/context/context.dart'; | 9 import 'package:analyzer/src/context/context.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| 11 import 'package:analyzer/src/generated/error.dart'; | 11 import 'package:analyzer/src/generated/error.dart'; |
| 12 import 'package:analyzer/src/task/options.dart'; | 12 import 'package:analyzer/src/task/options.dart'; |
| 13 import 'package:plugin/manager.dart'; | 13 import 'package:plugin/manager.dart'; |
| 14 import 'package:plugin/plugin.dart'; | 14 import 'package:plugin/plugin.dart'; |
| 15 import 'package:unittest/unittest.dart'; | 15 import 'package:unittest/unittest.dart'; |
| 16 import 'package:yaml/src/yaml_node.dart'; | 16 import 'package:yaml/src/yaml_node.dart'; |
| 17 | 17 |
| 18 import '../generated/test_support.dart'; | 18 import '../generated/test_support.dart'; |
| 19 import '../utils.dart'; | |
| 20 | 19 |
| 21 main() { | 20 main() { |
| 22 AnalysisError invalid_assignment = | 21 AnalysisError invalid_assignment = |
| 23 new AnalysisError(new TestSource(), 0, 1, HintCode.INVALID_ASSIGNMENT, [ | 22 new AnalysisError(new TestSource(), 0, 1, HintCode.INVALID_ASSIGNMENT, [ |
| 24 ['x'], | 23 ['x'], |
| 25 ['y'] | 24 ['y'] |
| 26 ]); | 25 ]); |
| 27 | 26 |
| 28 AnalysisError missing_return = | 27 AnalysisError missing_return = |
| 29 new AnalysisError(new TestSource(), 0, 1, HintCode.MISSING_RETURN, [ | 28 new AnalysisError(new TestSource(), 0, 1, HintCode.MISSING_RETURN, [ |
| 30 ['x'] | 29 ['x'] |
| 31 ]); | 30 ]); |
| 32 | 31 |
| 33 AnalysisError unused_local_variable = new AnalysisError( | 32 AnalysisError unused_local_variable = new AnalysisError( |
| 34 new TestSource(), 0, 1, HintCode.UNUSED_LOCAL_VARIABLE, [ | 33 new TestSource(), 0, 1, HintCode.UNUSED_LOCAL_VARIABLE, [ |
| 35 ['x'] | 34 ['x'] |
| 36 ]); | 35 ]); |
| 37 | 36 |
| 38 AnalysisError use_of_void_result = | 37 AnalysisError use_of_void_result = |
| 39 new AnalysisError(new TestSource(), 0, 1, HintCode.USE_OF_VOID_RESULT, [ | 38 new AnalysisError(new TestSource(), 0, 1, HintCode.USE_OF_VOID_RESULT, [ |
| 40 ['x'] | 39 ['x'] |
| 41 ]); | 40 ]); |
| 42 | 41 |
| 43 initializeTestEnvironment(); | |
| 44 oneTimeSetup(); | 42 oneTimeSetup(); |
| 45 | 43 |
| 46 setUp(() { | 44 setUp(() { |
| 47 context = new TestContext(); | 45 context = new TestContext(); |
| 48 }); | 46 }); |
| 49 | 47 |
| 50 group('ErrorProcessorTest', () { | 48 group('ErrorProcessorTest', () { |
| 51 test('configureOptions', () { | 49 test('configureOptions', () { |
| 52 configureOptions(''' | 50 configureOptions(''' |
| 53 analyzer: | 51 analyzer: |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 void oneTimeSetup() { | 139 void oneTimeSetup() { |
| 142 List<Plugin> plugins = <Plugin>[]; | 140 List<Plugin> plugins = <Plugin>[]; |
| 143 plugins.addAll(AnalysisEngine.instance.requiredPlugins); | 141 plugins.addAll(AnalysisEngine.instance.requiredPlugins); |
| 144 plugins.add(AnalysisEngine.instance.commandLinePlugin); | 142 plugins.add(AnalysisEngine.instance.commandLinePlugin); |
| 145 plugins.add(AnalysisEngine.instance.optionsPlugin); | 143 plugins.add(AnalysisEngine.instance.optionsPlugin); |
| 146 ExtensionManager manager = new ExtensionManager(); | 144 ExtensionManager manager = new ExtensionManager(); |
| 147 manager.processPlugins(plugins); | 145 manager.processPlugins(plugins); |
| 148 } | 146 } |
| 149 | 147 |
| 150 class TestContext extends AnalysisContextImpl {} | 148 class TestContext extends AnalysisContextImpl {} |
| OLD | NEW |