[javadoc] Add markdown code block formatter tests

IJ-CR-176793

GitOrigin-RevId: e5eeeb40490d99ba3a78fc4e856b7c18dbc686a3
This commit is contained in:
Louis Vignier
2025-09-30 13:17:41 +00:00
committed by intellij-monorepo-bot
parent de5dde0a13
commit 332aa07430
@@ -2314,20 +2314,51 @@ public class Test {
RIGHT_MARGIN = 120
}
doTextTest("""
val before = """
/// only this should be reformated
/// ```java
/// @Annotation public static final @Annotation2 List<String> myList = List.of("a", "b", "c");
/// ```
public class Foo {
}
""".trimIndent(), """
""".trimIndent()
val after = """
/// only this should be reformated
/// ```java
/// @Annotation public static final @Annotation2 List<String> myList = List.of("a", "b", "c");
/// ```
public class Foo {
}
""".trimIndent())
""".trimIndent()
doTextTest(before, after)
doTextTest(after, after)
}
fun testMarkdownTildeCodeBlock() {
settings.apply {
WRAP_COMMENTS = true
RIGHT_MARGIN = 120
}
val before = """
/// only this should be reformated
/// ~~~java ~
/// @Annotation public static final @Annotation2 List<String> myList = List.of("a", "b", "c");
/// ~~~
public class Foo {
}
""".trimIndent()
val after = """
/// only this should be reformated
/// ~~~java ~
/// @Annotation public static final @Annotation2 List<String> myList = List.of("a", "b", "c");
/// ~~~
public class Foo {
}
""".trimIndent()
doTextTest(before, after)
doTextTest(after, after)
}
}