Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/visitor/ToSourceVisitorTest.java |
=================================================================== |
--- editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/visitor/ToSourceVisitorTest.java (revision 15397) |
+++ editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/visitor/ToSourceVisitorTest.java (working copy) |
@@ -44,6 +44,7 @@ |
import static com.google.dart.engine.ast.ASTFactory.conditionalExpression; |
import static com.google.dart.engine.ast.ASTFactory.constructorDeclaration; |
import static com.google.dart.engine.ast.ASTFactory.constructorFieldInitializer; |
+import static com.google.dart.engine.ast.ASTFactory.constructorName; |
import static com.google.dart.engine.ast.ASTFactory.continueStatement; |
import static com.google.dart.engine.ast.ASTFactory.doStatement; |
import static com.google.dart.engine.ast.ASTFactory.doubleLiteral; |
@@ -370,6 +371,7 @@ |
"const C() {}", |
constructorDeclaration( |
Keyword.CONST, |
+ null, |
identifier("C"), |
null, |
formalParameterList(), |
@@ -380,7 +382,7 @@ |
public void test_visitConstructorDeclaration_external() { |
assertSource( |
"external C() ;", |
- constructorDeclaration(null, identifier("C"), null, formalParameterList(), null)); |
+ constructorDeclaration(identifier("C"), null, formalParameterList(), null)); |
} |
public void test_visitConstructorDeclaration_minimal() { |
@@ -388,6 +390,7 @@ |
"C() {}", |
constructorDeclaration( |
null, |
+ null, |
identifier("C"), |
null, |
formalParameterList(), |
@@ -400,6 +403,7 @@ |
"C() : a = b, c = d {}", |
constructorDeclaration( |
null, |
+ null, |
identifier("C"), |
null, |
formalParameterList(), |
@@ -414,6 +418,7 @@ |
"C(var a, var b) {}", |
constructorDeclaration( |
null, |
+ null, |
identifier("C"), |
null, |
formalParameterList( |
@@ -428,6 +433,7 @@ |
"C.m() {}", |
constructorDeclaration( |
null, |
+ null, |
identifier("C"), |
"m", |
formalParameterList(), |
@@ -440,6 +446,7 @@ |
"C() : a = b {}", |
constructorDeclaration( |
null, |
+ null, |
identifier("C"), |
null, |
formalParameterList(), |
@@ -455,6 +462,18 @@ |
assertSource("this.a = b", constructorFieldInitializer(true, "a", identifier("b"))); |
} |
+ public void test_visitConstructorName_named_prefix() { |
+ assertSource("p.C.n", constructorName(typeName("p.C.n"), null)); |
+ } |
+ |
+ public void test_visitConstructorName_unnamed_noPrefix() { |
+ assertSource("C", constructorName(typeName("C"), null)); |
+ } |
+ |
+ public void test_visitConstructorName_unnamed_prefix() { |
+ assertSource("p.C", constructorName(typeName(identifier("p", "C")), null)); |
+ } |
+ |
public void test_visitContinueStatement_label() { |
assertSource("continue l;", continueStatement("l")); |
} |