| 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_cli.test.driver; | 5 library analyzer_cli.test.driver; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:analyzer/plugin/options.dart'; | 9 import 'package:analyzer/plugin/options.dart'; |
| 10 import 'package:analyzer/source/analysis_options_provider.dart'; | 10 import 'package:analyzer/source/analysis_options_provider.dart'; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 'test/data/options_tests_project/test_file.dart', | 290 'test/data/options_tests_project/test_file.dart', |
| 291 '--options', | 291 '--options', |
| 292 'test/data/options_tests_project/.analysis_options' | 292 'test/data/options_tests_project/.analysis_options' |
| 293 ]); | 293 ]); |
| 294 }); | 294 }); |
| 295 tearDown(() { | 295 tearDown(() { |
| 296 outSink = savedOutSink; | 296 outSink = savedOutSink; |
| 297 }); | 297 }); |
| 298 | 298 |
| 299 test('filters', () { | 299 test('filters', () { |
| 300 var filters = | 300 var processors = |
| 301 driver.context.getConfigurationData(CONFIGURED_ERROR_FILTERS); | 301 driver.context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS); |
| 302 expect(filters, hasLength(1)); | 302 expect(processors, hasLength(1)); |
| 303 | 303 |
| 304 var unused_error = new AnalysisError( | 304 var unused_local_variable = new AnalysisError( |
| 305 new TestSource(), 0, 1, HintCode.UNUSED_LOCAL_VARIABLE, [ | 305 new TestSource(), 0, 1, HintCode.UNUSED_LOCAL_VARIABLE, [ |
| 306 ['x'] | 306 ['x'] |
| 307 ]); | 307 ]); |
| 308 expect(filters.any((filter) => filter(unused_error)), isTrue); | 308 |
| 309 var unusedLocalVariable = |
| 310 processors.firstWhere((p) => p.appliesTo(unused_local_variable)); |
| 311 expect(unusedLocalVariable.severity, isNull); |
| 309 }); | 312 }); |
| 310 | 313 |
| 311 test('language config', () { | 314 test('language config', () { |
| 312 expect(driver.context.analysisOptions.enableSuperMixins, isTrue); | 315 expect(driver.context.analysisOptions.enableSuperMixins, isTrue); |
| 313 }); | 316 }); |
| 314 }); | 317 }); |
| 315 }); | 318 }); |
| 316 | 319 |
| 317 group('in temp directory', () { | 320 group('in temp directory', () { |
| 318 StringSink savedOutSink, savedErrorSink; | 321 StringSink savedOutSink, savedErrorSink; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 this.options = options; | 480 this.options = options; |
| 478 } | 481 } |
| 479 } | 482 } |
| 480 | 483 |
| 481 class TestSource implements Source { | 484 class TestSource implements Source { |
| 482 TestSource(); | 485 TestSource(); |
| 483 | 486 |
| 484 @override | 487 @override |
| 485 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 488 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 486 } | 489 } |
| OLD | NEW |