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

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

Issue 137863002: Issue 8742. Preserve leading line comments during java2dart translation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test for block-style comment translation. 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/SyntaxTranslatorTest.java
diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java
index 0c8280c62ad31468b3690135f10919afaf28820c..031bfc42f471d9c4cfb8775b98196a509ec42636 100644
--- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java
+++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java
@@ -198,6 +198,50 @@ public class SyntaxTranslatorTest extends AbstractSemanticTest {
"}");
}
+ public void test_commentLine_beforeStatement_blockStyle() throws Exception {
+ parseJava(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "public class A {",
+ " void main() {",
+ " /*",
+ " * aaa",
+ " * bbb",
+ " */",
+ " int v = 0;",
+ " }",
+ "}");
+ assertDartSource(
+ "class A {",
+ " void main() {",
+ " /*",
+ " * aaa",
+ " * bbb",
+ " */",
+ " int v = 0;",
+ " }",
+ "}");
+ }
+
+ public void test_commentLine_beforeStatement_lineStyle() throws Exception {
+ parseJava(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "public class A {",
+ " void main() {",
+ " // aaa",
+ " // bbb",
+ " int v = 0;",
+ " }",
+ "}");
+ assertDartSource(
+ "class A {",
+ " void main() {",
+ " // aaa",
+ " // bbb",
+ " int v = 0;",
+ " }",
+ "}");
+ }
+
public void test_constructor() throws Exception {
parseJava(
"// filler filler filler filler filler filler filler filler filler filler",

Powered by Google App Engine
This is Rietveld 408576698