| 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.src.plugin.plugin_config_test; | 5 library test.src.plugin.plugin_config_test; | 
| 6 | 6 | 
| 7 import 'package:analyzer/source/analysis_options_provider.dart'; | 7 import 'package:analyzer/source/analysis_options_provider.dart'; | 
| 8 import 'package:analyzer/src/plugin/plugin_configuration.dart'; | 8 import 'package:analyzer/src/plugin/plugin_configuration.dart'; | 
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; | 
| 10 import 'package:yaml/yaml.dart'; | 10 import 'package:yaml/yaml.dart'; | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 38         expect(plugins[2].className, equals('MyPlugin')); | 38         expect(plugins[2].className, equals('MyPlugin')); | 
| 39       }); | 39       }); | 
| 40       test('plugin map (empty)', () { | 40       test('plugin map (empty)', () { | 
| 41         const optionsSrc = ''' | 41         const optionsSrc = ''' | 
| 42 analyzer: | 42 analyzer: | 
| 43   plugins: | 43   plugins: | 
| 44     # my_plugin1: ^0.1.0 #shorthand | 44     # my_plugin1: ^0.1.0 #shorthand | 
| 45 '''; | 45 '''; | 
| 46         var config = parseConfig(optionsSrc); | 46         var config = parseConfig(optionsSrc); | 
| 47         // Commented out plugins shouldn't cause a parse failure. | 47         // Commented out plugins shouldn't cause a parse failure. | 
| 48         expect(config.plugins.toList(), hasLength(0)); | 48         expect(config.plugins, hasLength(0)); | 
| 49       }); | 49       }); | 
| 50       group('errors', () { | 50       group('errors', () { | 
| 51         test('bad format', () { | 51         test('bad format', () { | 
| 52           const optionsSrc = ''' | 52           const optionsSrc = ''' | 
| 53 analyzer: | 53 analyzer: | 
| 54   plugins: | 54   plugins: | 
| 55     - my_plugin1 | 55     - my_plugin1 | 
| 56     - my_plugin2 | 56     - my_plugin2 | 
| 57 '''; | 57 '''; | 
| 58           try { | 58           try { | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 71   }); | 71   }); | 
| 72 } | 72 } | 
| 73 | 73 | 
| 74 PluginConfig parseConfig(String optionsSrc) { | 74 PluginConfig parseConfig(String optionsSrc) { | 
| 75   var options = new AnalysisOptionsProvider().getOptionsFromString(optionsSrc); | 75   var options = new AnalysisOptionsProvider().getOptionsFromString(optionsSrc); | 
| 76   return new PluginConfig.fromOptions(options); | 76   return new PluginConfig.fromOptions(options); | 
| 77 } | 77 } | 
| 78 | 78 | 
| 79 List<PluginInfo> pluginsSortedByName(PluginConfig config) => | 79 List<PluginInfo> pluginsSortedByName(PluginConfig config) => | 
| 80     config.plugins.toList()..sort((p1, p2) => p1.name.compareTo(p2.name)); | 80     config.plugins.toList()..sort((p1, p2) => p1.name.compareTo(p2.name)); | 
| OLD | NEW | 
|---|