mirror of
https://github.com/apple/pkl.git
synced 2026-08-28 14:37:18 +02:00
Sanitize block comment endings in generated Kotlin doc comments (#1830)
This commit is contained in:
@@ -2261,6 +2261,24 @@ class JavaCodeGeneratorTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `block comment escaping in doc comments`() {
|
||||
val javaCode =
|
||||
generateJavaCode(
|
||||
"""
|
||||
module my.mod
|
||||
class Person {
|
||||
/// This doc coment needs */ escaping
|
||||
foo: Int
|
||||
}
|
||||
"""
|
||||
.trimIndent(),
|
||||
JavaCodeGeneratorOptions(generateJavadoc = true),
|
||||
)
|
||||
|
||||
assertThat(javaCode).compilesSuccessfully().contains("*/")
|
||||
}
|
||||
|
||||
private fun Map<String, String>.validateContents(
|
||||
@Suppress("RemoveRedundantQualifierName") vararg assertions: kotlin.Pair<String, List<String>>
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user