aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-06-30 08:03:38 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-01 09:43:03 +0200
commita16e101fad10d024a84aa36069ec6032fcbaf3e6 (patch)
tree64e19695dccd67c3e1b1621eeac2ad469e01cb46 /plugins/base/src/test
parent14e71e40dfab5f18ccd56b0c015383c0dfb5df51 (diff)
downloaddokka-a16e101fad10d024a84aa36069ec6032fcbaf3e6.tar.gz
dokka-a16e101fad10d024a84aa36069ec6032fcbaf3e6.tar.bz2
dokka-a16e101fad10d024a84aa36069ec6032fcbaf3e6.zip
Implement `AbstractJavadocTemplateMapTest` API
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r--plugins/base/src/test/kotlin/basic/DRITest.kt11
-rw-r--r--plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt3
-rw-r--r--plugins/base/src/test/kotlin/enums/EnumsTest.kt3
-rw-r--r--plugins/base/src/test/kotlin/model/JavaTest.kt4
4 files changed, 12 insertions, 9 deletions
diff --git a/plugins/base/src/test/kotlin/basic/DRITest.kt b/plugins/base/src/test/kotlin/basic/DRITest.kt
index b09932fe..1f4c7d93 100644
--- a/plugins/base/src/test/kotlin/basic/DRITest.kt
+++ b/plugins/base/src/test/kotlin/basic/DRITest.kt
@@ -1,11 +1,12 @@
package basic
import org.jetbrains.dokka.links.*
-import org.jetbrains.dokka.model.DClass
-import org.jetbrains.dokka.model.DFunction
-import org.jetbrains.dokka.model.DParameter
-import org.jetbrains.dokka.model.OtherParameter
+import org.jetbrains.dokka.links.Callable
+import org.jetbrains.dokka.links.Nullable
+import org.jetbrains.dokka.links.TypeConstructor
+import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.pages.*
+import org.jetbrains.dokka.pages.dfs
import org.junit.jupiter.api.Assertions.assertEquals
import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest
@@ -158,7 +159,7 @@ class DRITest : AbstractCoreTest() {
)
val driCount = module
- .asSequence()
+ .withDescendants()
.filterIsInstance<ContentPage>()
.sumBy { it.dri.count { dri -> dri == expectedDRI } }
diff --git a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
index 2e05d241..f6e80891 100644
--- a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
+++ b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
@@ -3,6 +3,7 @@ package content.params
import matchers.content.*
import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.model.DFunction
+import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.model.doc.DocumentationNode
import org.jetbrains.dokka.model.doc.Param
import org.jetbrains.dokka.model.doc.Text
@@ -607,4 +608,4 @@ class ContentForParamsTest : AbstractCoreTest() {
private fun DocumentationNode.paramsDescription(): String =
children.firstIsInstanceOrNull<Param>()?.root?.children?.firstIsInstanceOrNull<Text>()?.body.orEmpty()
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/enums/EnumsTest.kt b/plugins/base/src/test/kotlin/enums/EnumsTest.kt
index dba5c24a..be910b5c 100644
--- a/plugins/base/src/test/kotlin/enums/EnumsTest.kt
+++ b/plugins/base/src/test/kotlin/enums/EnumsTest.kt
@@ -3,6 +3,7 @@ package enums
import matchers.content.*
import org.jetbrains.dokka.model.ConstructorValues
import org.jetbrains.dokka.model.DEnum
+import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest
import org.junit.jupiter.api.Assertions.*
@@ -230,4 +231,4 @@ class EnumsTest : AbstractCoreTest() {
private fun ContentGroup.constructorSignature(): String =
(children.single() as ContentGroup).children.drop(1).joinToString(separator = "") { (it as ContentText).text }
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt
index bd7e3b55..4cad784b 100644
--- a/plugins/base/src/test/kotlin/model/JavaTest.kt
+++ b/plugins/base/src/test/kotlin/model/JavaTest.kt
@@ -34,7 +34,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") {
with((this / "fn").cast<DFunction>()) {
name equals "fn"
val params = parameters.map { it.documentation.values.first().children.first() as Param }
- params.mapNotNull { it.firstChildOfType<Text>()?.body } equals listOf("is String parameter", "is int parameter")
+ params.mapNotNull { it.firstChildOfTypeOrNull<Text>()?.body } equals listOf("is String parameter", "is int parameter")
}
}
}
@@ -449,4 +449,4 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") {
// assertEquals(1, inheritors.size)
// }
// }
-} \ No newline at end of file
+}