Skip to content

Commit 211ff6f

Browse files
cpovirkgoogle-java-format Team
authored andcommitted
Add a test to demonstrate our current handling of Javadoc that starts with a MOE comment.
(I haven't checked what the actual rendered Javadoc would look like for such Javadoc, including what happens to the summary fragment. It might well be a bad idea.) I hope to change the behavior in unknown commit. PiperOrigin-RevId: 945817704
1 parent 5498e81 commit 211ff6f

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,32 @@ class Test {}
254254
doFormatTest(input, expected);
255255
}
256256

257+
@Test
258+
public void moeCommentAtStartOfDoc() {
259+
String input =
260+
"""
261+
/**
262+
* <!-- moe:begin_intracomment_strip -->
263+
* Foo.
264+
* <!-- moe:end_intracomment_strip -->
265+
*/
266+
class Test {}\
267+
"""
268+
.replace("moe", "MOE");
269+
String expected =
270+
"""
271+
/**
272+
*
273+
* <!-- moe:begin_intracomment_strip -->
274+
* Foo.
275+
* <!-- moe:end_intracomment_strip -->
276+
*/
277+
class Test {}
278+
"""
279+
.replace("moe", "MOE");
280+
doFormatTest(input, expected);
281+
}
282+
257283
@Test
258284
public void tableMostlyUntouched() {
259285
String input =

0 commit comments

Comments
 (0)