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

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

Issue 16302002: analyzer_experimental snapshot (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 424fb421cc0d91906d6567dd1949e8399e4ab070..af7b79f98fb31f8ea426b3d16db6c817d7b588c7 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
@@ -50,6 +50,24 @@ public class ObjectSemanticProcessorTest extends SemanticProcessorTest {
"}");
}
+ public void test_Boolean_orEq() throws Exception {
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test {",
+ " public void test(boolean a, boolean b) {",
+ " a |= b;",
+ " }",
+ "}");
+ runProcessor();
+ assertFormattedSource(
+ "class Test {",
+ " void test(bool a, bool b) {",
+ " a = javaBooleanOr(a, b);",
+ " }",
+ "}");
+ }
+
public void test_Boolean_TRUE() throws Exception {
translateSingleFile(
"// filler filler filler filler filler filler filler filler filler filler",
@@ -401,6 +419,22 @@ public class ObjectSemanticProcessorTest extends SemanticProcessorTest {
"}");
}
+ public void test_Number_intValue() throws Exception {
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test {",
+ " public int main(Number p) {",
+ " return p.intValue();",
+ " }",
+ "}");
+ runProcessor();
+ assertFormattedSource(//
+ "class Test {",
+ " int main(num p) => p.toInt();",
+ "}");
+ }
+
public void test_Object_equals() throws Exception {
translateSingleFile(
"// filler filler filler filler filler filler filler filler filler filler",
@@ -776,19 +810,41 @@ public class ObjectSemanticProcessorTest extends SemanticProcessorTest {
"}");
}
+ public void test_String_plusEqualsChar() throws Exception {
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test {",
+ " public void test(String s) {",
+ " s += '=';",
+ " }",
+ "}");
+ runProcessor();
+ assertFormattedSource(//
+ "class Test {",
+ " void test(String s) {",
+ " s += '=';",
+ " }",
+ "}");
+ }
+
public void test_String_replace() throws Exception {
translateSingleFile(
"// filler filler filler filler filler filler filler filler filler filler",
"package test;",
"public class Test {",
- " public String foo(String s, String p, String r) {",
+ " public String testA(String s, String p, String r) {",
" return s.replace(p, r);",
" }",
+ " public String testB(String s, String r) {",
+ " return s.replace('/', r);",
+ " }",
"}");
runProcessor();
- assertFormattedSource(//
+ assertFormattedSource(
"class Test {",
- " String foo(String s, String p, String r) => s.replaceAll(p, r);",
+ " String testA(String s, String p, String r) => s.replaceAll(p, r);",
+ " String testB(String s, String r) => s.replaceAll('/', r);",
"}");
}
@@ -864,6 +920,24 @@ public class ObjectSemanticProcessorTest extends SemanticProcessorTest {
"}");
}
+ public void test_Throwable_getMessage() throws Exception {
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test {",
+ " public main(Throwable e) {",
+ " e.getMessage();",
+ " }",
+ "}");
+ runProcessor();
+ assertFormattedSource(//
+ "class Test {",
+ " main(Exception e) {",
+ " e.toString();",
+ " }",
+ "}");
+ }
+
public void test_Throwable_printStackTrace() throws Exception {
translateSingleFile(
"// filler filler filler filler filler filler filler filler filler filler",

Powered by Google App Engine
This is Rietveld 408576698