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

Unified Diff: tests/compiler/dart2js/unparser_test.dart

Issue 10692186: Fix factory constructors unparse: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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
Index: tests/compiler/dart2js/unparser_test.dart
diff --git a/tests/compiler/dart2js/unparser_test.dart b/tests/compiler/dart2js/unparser_test.dart
index 3aab4d45f6742f1a75c1eeb92af4c7e42f52cb4c..6bdb32dee4e081a2b9e30073adbcbb3c94022008 100644
--- a/tests/compiler/dart2js/unparser_test.dart
+++ b/tests/compiler/dart2js/unparser_test.dart
@@ -85,6 +85,7 @@ testClosure() {
testIndexedOperatorDecl() {
testUnparseMember('operator[](int i)=> null;');
+ testUnparseMember('operator[]=(int i, int j)=> null;');
}
testNativeMethods() {
@@ -161,6 +162,13 @@ testGetSet() {
testDart2Dart('String get foo(){return "a";}main(){foo;}');
}
+testFactoryConstructor() {
+ testDart2Dart('main(){new A.fromFoo();}class A{A.fromFoo();}');
+ // Now more complicated, with normal constructor and factory parameters.
+ testDart2Dart('main(){new A.fromFoo(5);}'
+ 'class A{A(this.f);A.fromFoo(foo):this("f");final String f;}');
+}
+
main() {
testGenericTypes();
testForLoop();
@@ -177,5 +185,6 @@ main() {
testClassWithMethod();
testVariableDefinitions();
testGetSet();
+ testFactoryConstructor();
testTopLevelField();
}

Powered by Google App Engine
This is Rietveld 408576698