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

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

Issue 24481002: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/processor/ObjectSemanticProcessorTest.java
diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/ObjectSemanticProcessorTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/ObjectSemanticProcessorTest.java
index 152339307255a3065303132fb514899bcd9022c9..298354b554bb6de50444598673683aa3b05d9f82 100644
--- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/ObjectSemanticProcessorTest.java
+++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/ObjectSemanticProcessorTest.java
@@ -168,6 +168,30 @@ public class ObjectSemanticProcessorTest extends SemanticProcessorTest {
"}");
}
+ public void test_Enum_name() throws Exception {
+ setFileLines(
+ "test/MyEnum.java",
+ toString(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public enum MyEnum {",
+ " ONE, TWO;",
+ "}"));
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test {",
+ " public void test() {",
+ " return MyEnum.ONE.name();",
+ " }",
+ "}");
+ runProcessor();
+ assertFormattedSource(//
+ "class Test {",
+ " void test() => MyEnum.ONE.name;",
+ "}");
+ }
+
public void test_Enum_ordinal() throws Exception {
setFileLines(
"test/MyEnum.java",
@@ -688,6 +712,44 @@ public class ObjectSemanticProcessorTest extends SemanticProcessorTest {
"}");
}
+ public void test_regex_Matcher() throws Exception {
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "import java.util.regex.*;",
+ "public class Test {",
+ " void main(Pattern p, String s) {",
+ " Matcher m = p.matcher(s);",
+ " }",
+ "}");
+ runProcessor();
+ assertFormattedSource(//
+ "class Test {",
+ " void main(RegExp p, String s) {",
+ " JavaPatternMatcher m = new JavaPatternMatcher(p, s);",
+ " }",
+ "}");
+ }
+
+ public void test_regex_Pattern() throws Exception {
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "import java.util.regex.*;",
+ "public class Test {",
+ " void main(String s) {",
+ " Pattern.compile(s);",
+ " }",
+ "}");
+ runProcessor();
+ assertFormattedSource(//
+ "class Test {",
+ " void main(String s) {",
+ " new RegExp(s);",
+ " }",
+ "}");
+ }
+
public void test_String_charAt() throws Exception {
translateSingleFile(
"// filler filler filler filler filler filler filler filler filler filler",

Powered by Google App Engine
This is Rietveld 408576698