Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: test/driver_test.dart

Issue 1373903004: Bootloader initialization cleanup. (Closed) Base URL: https://github.com/dart-lang/analyzer_cli.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/plugin/plugin_config_processor_plugin.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/driver_test.dart
diff --git a/test/driver_test.dart b/test/driver_test.dart
index 0e6419ae19dbc690bf8298e240370b3d96b07e9b..ae67508c1025364e77ade9ad4fe3c750345828c4 100644
--- a/test/driver_test.dart
+++ b/test/driver_test.dart
@@ -8,6 +8,7 @@ library analyzer_cli.test.driver;
import 'dart:io';
import 'package:analyzer/plugin/options.dart';
+import 'package:analyzer_cli/src/bootloader.dart';
import 'package:analyzer_cli/src/driver.dart';
import 'package:linter/src/plugin/linter_plugin.dart';
import 'package:path/path.dart' as path;
@@ -30,39 +31,6 @@ main() {
expect(processor.options['test_plugin'], isNotNull);
expect(processor.exception, isNull);
});
- group('plugin processing', () {
- StringSink savedErrorSink;
- setUp(() {
- savedErrorSink = errorSink;
- errorSink = new StringBuffer();
- });
- tearDown(() {
- errorSink = savedErrorSink;
- });
- test('bad format', () {
- Driver driver = new Driver();
- driver.start([
- '--options',
- 'test/data/bad_plugin_options.yaml',
- 'test/data/test_file.dart'
- ]);
- expect(
- errorSink.toString(),
- equals(
- 'Plugin configuration skipped: Unrecognized plugin config format, expected `YamlMap`, got `YamlList` (line 2, column 4)\n'));
- });
- test('plugin config', () {
- Driver driver = new Driver();
- driver.start([
- '--options',
- 'test/data/plugin_options.yaml',
- 'test/data/test_file.dart'
- ]);
- var plugins = driver.pluginConfig.plugins;
- expect(plugins, hasLength(1));
- expect(plugins.first.name, equals('my_plugin1'));
- });
- });
});
group('linter', () {
@@ -151,6 +119,41 @@ main() {}
});
});
});
+ group('Bootloader', () {
+ group('plugin processing', () {
+ StringSink savedErrorSink;
+ setUp(() {
+ savedErrorSink = errorSink;
+ errorSink = new StringBuffer();
+ });
+ tearDown(() {
+ errorSink = savedErrorSink;
+ });
+ test('bad format', () {
+ BootLoader loader = new BootLoader();
+ loader.createImage([
+ '--options',
+ 'test/data/bad_plugin_options.yaml',
+ 'test/data/test_file.dart'
+ ]);
+ expect(
+ errorSink.toString(),
+ equals(
+ 'Plugin configuration skipped: Unrecognized plugin config format, expected `YamlMap`, got `YamlList` (line 2, column 4)\n'));
+ });
+ test('plugin config', () {
+ BootLoader loader = new BootLoader();
+ Image image = loader.createImage([
+ '--options',
+ 'test/data/plugin_options.yaml',
+ 'test/data/test_file.dart'
+ ]);
+ var plugins = image.config.plugins;
+ expect(plugins, hasLength(1));
+ expect(plugins.first.name, equals('my_plugin1'));
+ });
+ });
+ });
}
class TestPlugin extends Plugin {
« no previous file with comments | « lib/src/plugin/plugin_config_processor_plugin.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698