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

Unified Diff: test/common.dart

Issue 865293002: support basic identifiers in constructors (Closed) Base URL: git@github.com:dart-lang/static-init.git@master
Patch Set: rebase Created 5 years, 11 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/transformer.dart ('k') | test/transformer_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/common.dart
diff --git a/test/common.dart b/test/common.dart
index 859b72e06277b4bdf0c009764ed7ab5619c45f43..f121be5841a65b4be01914fa648a9a3a3f41a85c 100644
--- a/test/common.dart
+++ b/test/common.dart
@@ -15,3 +15,37 @@ testPhases(String testName, List<List<Transformer>> phases,
return helper.checkAll(expectedFiles).whenComplete(() => helper.tearDown());
});
}
+
+// Simple mock of initialize.
+const mockInitialize = '''
+ library initialize;
+
+ abstract class Initializer<T> {}
+
+ class _InitMethod implements Initializer<Function> {
+ const _InitMethod();
+ }
+ const _InitMethod initMethod = const _InitMethod();''';
+
+// Some simple initializers for use in tests.
+const commonInitializers = '''
+ library test_initializers;
+
+ import 'package:initialize/initialize.dart';
+
+ class _ConstInit extends Initializer<dynamic> {
+ const ConstInit();
+ }
+ const _ConstInit constInit = const _ConstInit();
+
+ class DynamicInit extends Initializer<dynamic> {
+ final dynamic _value;
+ const DynamicInit(this._value);
+ }
+
+ class NamedArgInit extends Initializer<dynamic> {
+ final dynamic _first;
+ final dynamic name;
+ const NamedArgInit(this._first, {this.name});
+ }
+ ''';
« no previous file with comments | « lib/transformer.dart ('k') | test/transformer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698