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

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

Issue 16337007: Version 0.5.13.1 . (Closed) Base URL: http://dart.googlecode.com/svn/trunk/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
===================================================================
--- editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/ObjectSemanticProcessorTest.java (revision 23549)
+++ editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/ObjectSemanticProcessorTest.java (working copy)
@@ -50,6 +50,24 @@
"}");
}
+ 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 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 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 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