| 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'; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 test_linter_undefined_rule() { | 67 test_linter_undefined_rule() { |
| 68 validate( | 68 validate( |
| 69 ''' | 69 ''' |
| 70 linter: | 70 linter: |
| 71 rules: | 71 rules: |
| 72 - undefined | 72 - undefined |
| 73 ''', | 73 ''', |
| 74 [UNDEFINED_LINT_WARNING]); | 74 [UNDEFINED_LINT_WARNING]); |
| 75 } | 75 } |
| 76 | 76 |
| 77 validate(String source, List<AnalysisOptionsErrorCode> expected) { | 77 validate(String source, List<ErrorCode> expected) { |
| 78 var options = optionsProvider.getOptionsFromString(source); | 78 var options = optionsProvider.getOptionsFromString(source); |
| 79 validator.validate(reporter, options); | 79 validator.validate(reporter, options); |
| 80 expect(errors.map((AnalysisError e) => e.errorCode), | 80 expect(errors.map((AnalysisError e) => e.errorCode), |
| 81 unorderedEquals(expected)); | 81 unorderedEquals(expected)); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 class _TestSource implements Source { | 85 class _TestSource implements Source { |
| 86 @override | 86 @override |
| 87 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 87 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 88 } | 88 } |
| OLD | NEW |