-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix preserving spaces in Javadoc comments (#1923)
Fixes #1895
- Loading branch information
1 parent
c94c4ba
commit d89be4b
Showing
3 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package parsers | ||
|
||
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest | ||
import org.jetbrains.dokka.model.DEnum | ||
import org.jetbrains.dokka.model.DModule | ||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.api.Test | ||
import utils.text | ||
|
||
class JavadocParserTest : BaseAbstractTest() { | ||
|
||
private fun performJavadocTest(testOperation: (DModule) -> Unit) { | ||
val configuration = dokkaConfiguration { | ||
sourceSets { | ||
sourceSet { | ||
sourceRoots = listOf("src/main/java") | ||
} | ||
} | ||
} | ||
|
||
testInline( | ||
""" | ||
|/src/main/java/sample/Date2.java | ||
| | ||
|package docs | ||
|/** | ||
| * class level docs | ||
| */ | ||
|public enum AnEnumType { | ||
| /** | ||
| * content being refreshed, which can be a result of | ||
| * invalidation, refresh that may contain content updates, or the initial load. | ||
| */ | ||
| REFRESH | ||
|} | ||
""".trimIndent(), | ||
configuration | ||
) { | ||
documentablesMergingStage = testOperation | ||
} | ||
} | ||
|
||
@Test | ||
fun `correctly parsed list`() { | ||
performJavadocTest { module -> | ||
val docs = (module.packages.single().classlikes.single() as DEnum).entries.single().documentation.values.single().children.single().root.text() | ||
assertEquals("content being refreshed, which can be a result of invalidation, refresh that may contain content updates, or the initial load.", docs.trimEnd()) | ||
} | ||
} | ||
} |