diff options
author | Marcin Aman <maman@virtuslab.com> | 2020-08-19 20:09:12 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-28 15:37:55 +0200 |
commit | de809e8076b3cde06dc29328298112ed4a7026b3 (patch) | |
tree | 8773b5f9d0d148d366cd7f250c268716b156b55d /plugins/base/src/test/kotlin/translators/JavadocParserTest.kt | |
parent | e64cb9bfbef093bcc4046a5081393f3c9778b42a (diff) | |
download | dokka-de809e8076b3cde06dc29328298112ed4a7026b3.tar.gz dokka-de809e8076b3cde06dc29328298112ed4a7026b3.tar.bz2 dokka-de809e8076b3cde06dc29328298112ed4a7026b3.zip |
Draft for improving code formatting #1346
Diffstat (limited to 'plugins/base/src/test/kotlin/translators/JavadocParserTest.kt')
-rw-r--r-- | plugins/base/src/test/kotlin/translators/JavadocParserTest.kt | 26 |
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"> + | * <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> + | * </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()) + } + } } |