aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/translators/JavadocParserTest.kt')
-rw-r--r--plugins/base/src/test/kotlin/translators/JavadocParserTest.kt26
1 files changed, 25 insertions, 1 deletions
diff --git a/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt b/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt
index a1fbb2a0..8ffcfb3c 100644
--- a/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt
+++ b/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt
@@ -6,7 +6,6 @@ import org.jetbrains.dokka.model.childrenOfType
import org.jetbrains.dokka.model.doc.*
import org.jetbrains.dokka.model.firstChildOfType
import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest
-import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.*
import utils.text
@@ -100,6 +99,15 @@ class JavadocParserTest : AbstractCoreTest() {
| * minute, but this specification follows the date and time conventions
| * for ISO C.
| * </ul>
+ | * <pre class="prettyprint">
+ | * &lt;androidx.fragment.app.FragmentContainerView
+ | * xmlns:android="http://schemas.android.com/apk/res/android"
+ | * xmlns:app="http://schemas.android.com/apk/res-auto"
+ | * android:id="@+id/fragment_container_view"
+ | * android:layout_width="match_parent"
+ | * android:layout_height="match_parent"&gt;
+ | * &lt;/androidx.fragment.app.FragmentContainerView&gt;
+ | * </pre>
| * <p>
| * In all cases, arguments given to methods for these purposes need
| * not fall within the indicated ranges; for example, a date may be
@@ -153,4 +161,20 @@ class JavadocParserTest : AbstractCoreTest() {
assertEquals("java.util.Calendar", sees[1].name)
}
}
+
+ @Test
+ fun `correctly parsed code block`(){
+ performJavadocTest { module ->
+ val dateDescription = module.descriptionOf("Date2")!!
+ val preTagContent = dateDescription.firstChildOfType<Pre>().firstChildOfType<Text>()
+ val expectedText = """<androidx.fragment.app.FragmentContainerView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/fragment_container_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ </androidx.fragment.app.FragmentContainerView>""".trimIndent()
+ assertEquals(expectedText.trim(), preTagContent.body.trim())
+ }
+ }
}