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

Unified Diff: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java

Issue 135803003: Translate index. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
Index: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
index 5ffaf315b1eacdc636311614b6148eb5a4984728..61abadb56849e72a86d0bf24b22de27904bf0ea6 100644
--- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
+++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
@@ -755,6 +755,46 @@ public class SemanticTest extends AbstractSemanticTest {
getFormattedSource(unit));
}
+ public void test_constructor_typeArgs() throws Exception {
+ setFileLines(
+ "test/Test.java",
+ toString(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test<T> {",
+ " Test() {",
+ " print(0);",
+ " }",
+ " Test(int p) {",
+ " print(1);",
+ " }",
+ " static void main() {",
+ " new Test<String>();",
+ " new Test<String>(2);",
+ " }",
+ "}",
+ ""));
+ Context context = new Context();
+ context.addSourceFolder(tmpFolder);
+ context.addSourceFiles(tmpFolder);
+ CompilationUnit unit = context.translate();
+ assertEquals(
+ toString(
+ "class Test<T> {",
+ " Test() {",
+ " print(0);",
+ " }",
+ " Test.con1(int p) {",
+ " print(1);",
+ " }",
+ " static void main() {",
+ " new Test<String>();",
+ " new Test<String>.con1(2);",
+ " }",
+ "}"),
+ getFormattedSource(unit));
+ }
+
public void test_ensurePrimitiveFieldInitializer() throws Exception {
setFileLines(
"test/Test.java",

Powered by Google App Engine
This is Rietveld 408576698