From 211ff6f9c498b31096953ea609dda0b557b7f101 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Fri, 10 Jul 2026 11:43:21 -0700 Subject: [PATCH] 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 --- .../java/JavadocFormattingTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java b/core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java index 02aaf79cb..267aacd73 100644 --- a/core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java +++ b/core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java @@ -254,6 +254,32 @@ class Test {} doFormatTest(input, expected); } + @Test + public void moeCommentAtStartOfDoc() { + String input = + """ + /** + * + * Foo. + * + */ + class Test {}\ + """ + .replace("moe", "MOE"); + String expected = + """ + /** + * + * + * Foo. + * + */ + class Test {} + """ + .replace("moe", "MOE"); + doFormatTest(input, expected); + } + @Test public void tableMostlyUntouched() { String input =