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

Unified Diff: test/plugin_transformer_test.dart

Issue 923733002: Major refactor of the transformer, added an `InitializePlugin` class which allows you to hook direc… (Closed) Base URL: git@github.com:dart-lang/static-init.git@master
Patch Set: wrapup Created 5 years, 10 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 | « pubspec.yaml ('k') | test/transformer_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/plugin_transformer_test.dart
diff --git a/test/plugin_transformer_test.dart b/test/plugin_transformer_test.dart
deleted file mode 100644
index df2a6e493e97e85adc692dc6fcb4afdecdcb35ec..0000000000000000000000000000000000000000
--- a/test/plugin_transformer_test.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-library initialize.plugin_transformer_test;
-
-import 'package:analyzer/analyzer.dart';
-import 'package:initialize/plugin_transformer.dart';
-import 'package:source_maps/refactor.dart';
-import 'package:unittest/compact_vm_config.dart';
-import 'common.dart';
-
-// Simple plugin which just removes all initMethod initializers.
-class DeleteInitMethodPlugin extends InitializePluginTransformer {
- DeleteInitMethodPlugin(String bootstrap) : super(bootstrap);
-
- initEntry(
- InstanceCreationExpression expression, TextEditTransaction transaction) {
- var firstArg = expression.argumentList.arguments[0];
- if (firstArg is PrefixedIdentifier &&
- firstArg.identifier.toString() == 'initMethod') {
- removeInitializer(expression, transaction);
- }
- }
-}
-
-main() {
- useCompactVMConfiguration();
-
- var transformer = new DeleteInitMethodPlugin('web/index.bootstrap.dart');
-
- testPhases('basic', [[transformer]], {
- 'a|web/index.bootstrap.dart': '''
-import 'package:initialize/src/static_loader.dart';
-import 'package:initialize/initialize.dart';
-import 'index.dart' as i0;
-
-main() {
- initializers.addAll([
- new InitEntry(i0.initMethod, const LibraryIdentifier(#a, null, 'a.dart')),
- new InitEntry(i0.initMethod, const LibraryIdentifier(#a, 'a', 'a.dart')),
- new InitEntry(i0.initMethod, i0.a),
- new InitEntry(const i0.DynamicInit('a()'), i0.a),
- ]);
-
- i0.main();
-}
-'''
- }, {
- 'a|web/index.bootstrap.dart': '''
-import 'package:initialize/src/static_loader.dart';
-import 'package:initialize/initialize.dart';
-import 'index.dart' as i0;
-
-main() {
- initializers.addAll([
- new InitEntry(const i0.DynamicInit('a()'), i0.a),
- ]);
-
- i0.main();
-}
-'''
- }, []);
-}
« no previous file with comments | « pubspec.yaml ('k') | test/transformer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698