| 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 test.services.linter; | 5 library test.services.linter; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/services/linter/linter.dart'; | 7 import 'package:analysis_server/src/services/linter/linter.dart'; |
| 8 import 'package:analyzer/analyzer.dart'; | 8 import 'package:analyzer/analyzer.dart'; |
| 9 import 'package:analyzer/source/analysis_options_provider.dart'; | 9 import 'package:analyzer/source/analysis_options_provider.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| 11 import 'package:analyzer/src/generated/source.dart'; | 11 import 'package:analyzer/src/generated/source.dart'; |
| 12 import 'package:test/test.dart'; |
| 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 13 import 'package:unittest/unittest.dart'; | |
| 14 | 14 |
| 15 import '../../utils.dart'; | 15 import '../../utils.dart'; |
| 16 | 16 |
| 17 main() { | 17 main() { |
| 18 initializeTestEnvironment(); | 18 initializeTestEnvironment(); |
| 19 defineReflectiveTests(LinterRuleOptionsValidatorTest); | 19 defineReflectiveSuite(() { |
| 20 defineReflectiveTests(LinterRuleOptionsValidatorTest); |
| 21 }); |
| 20 } | 22 } |
| 21 | 23 |
| 22 @reflectiveTest | 24 @reflectiveTest |
| 23 class LinterRuleOptionsValidatorTest { | 25 class LinterRuleOptionsValidatorTest { |
| 24 final LinterRuleOptionsValidator validator = new LinterRuleOptionsValidator(); | 26 final LinterRuleOptionsValidator validator = new LinterRuleOptionsValidator(); |
| 25 final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider(); | 27 final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider(); |
| 26 | 28 |
| 27 RecordingErrorListener recorder; | 29 RecordingErrorListener recorder; |
| 28 ErrorReporter reporter; | 30 ErrorReporter reporter; |
| 29 | 31 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 validator.validate(reporter, options); | 81 validator.validate(reporter, options); |
| 80 expect(errors.map((AnalysisError e) => e.errorCode), | 82 expect(errors.map((AnalysisError e) => e.errorCode), |
| 81 unorderedEquals(expected)); | 83 unorderedEquals(expected)); |
| 82 } | 84 } |
| 83 } | 85 } |
| 84 | 86 |
| 85 class _TestSource implements Source { | 87 class _TestSource implements Source { |
| 86 @override | 88 @override |
| 87 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 89 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 88 } | 90 } |
| OLD | NEW |