diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-06-23 13:37:58 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-06-24 10:47:42 +0200 |
commit | ded608b8e0c1fcde7b7e3c5089af49b379b7bab3 (patch) | |
tree | 470cd892fbb39667eb22b0ca208aa1ce4aef0629 | |
parent | b7c4beec1b6317b1ceaf2520464996e9ee0e93e5 (diff) | |
download | dokka-ded608b8e0c1fcde7b7e3c5089af49b379b7bab3.tar.gz dokka-ded608b8e0c1fcde7b7e3c5089af49b379b7bab3.tar.bz2 dokka-ded608b8e0c1fcde7b7e3c5089af49b379b7bab3.zip |
Fix tests
6 files changed, 12 insertions, 8 deletions
diff --git a/core/src/main/kotlin/model/documentableProperties.kt b/core/src/main/kotlin/model/documentableProperties.kt index 1a0c6303..2aec199c 100644 --- a/core/src/main/kotlin/model/documentableProperties.kt +++ b/core/src/main/kotlin/model/documentableProperties.kt @@ -11,8 +11,7 @@ data class InheritedFunction(val inheritedFrom: SourceSetDependent<DRI?>): Extra ) } - val isInherited: Boolean - get() = inheritedFrom != null + fun isInherited(sourceSetDependent: SourceSetData): Boolean = inheritedFrom[sourceSetDependent] != null override val key: ExtraProperty.Key<DFunction, *> = InheritedFunction } diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index fb8cbf9e..a6dd337a 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -61,8 +61,12 @@ open class DefaultPageCreator( open fun pageForTypeAlias(t: DTypeAlias) = MemberPageNode(t.name, contentForTypeAlias(t), setOf(t.dri), t) - private val WithScope.filteredFunctions - get() = functions.filter { it.extra[InheritedFunction]?.isInherited != true } + private val WithScope.filteredFunctions: List<DFunction> + get() = functions.flatMap { dFunction -> + dFunction.sourceSets.mapNotNull { sourceSetData -> + dFunction.takeIf { it.extra[InheritedFunction]?.isInherited(sourceSetData) != true } + } + } protected open fun contentForModule(m: DModule) = contentBuilder.contentFor(m) { group(kind = ContentKind.Cover) { diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index fcb81a13..6d17fdd1 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -496,7 +496,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class """.trimIndent() ){ with((this / "classes" / "Tested").cast<DClass>()){ - extra[ImplementedInterfaces]?.interfaces?.map { it.sureClassNames }?.sorted() equals listOf("Highest", "Lower", "LowerImplInterface").sorted() + extra[ImplementedInterfaces]?.interfaces?.entries?.single()?.value?.map { it.sureClassNames }?.sorted() equals listOf("Highest", "Lower", "LowerImplInterface").sorted() } } } diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index 77fcc666..aefcc642 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -52,7 +52,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |class Tested extends Extendable implements Lower { } """){ with((this / "java" / "Tested").cast<DClass>()){ - extra[ImplementedInterfaces]?.interfaces?.map { it.sureClassNames }?.sorted() equals listOf("Highest", "Lower").sorted() + extra[ImplementedInterfaces]?.interfaces?.entries?.single()?.value?.map { it.sureClassNames }?.sorted() equals listOf("Highest", "Lower").sorted() } } } diff --git a/plugins/javadoc/src/main/kotlin/javadoc/KorteJavadocRenderer.kt b/plugins/javadoc/src/main/kotlin/javadoc/KorteJavadocRenderer.kt index 22b0225b..600cdd99 100644 --- a/plugins/javadoc/src/main/kotlin/javadoc/KorteJavadocRenderer.kt +++ b/plugins/javadoc/src/main/kotlin/javadoc/KorteJavadocRenderer.kt @@ -278,7 +278,9 @@ class KorteJavadocRenderer(val outputWriter: OutputWriter, val context: DokkaCon .orEmpty() private fun renderClasslikeMethods(nodes: List<JavadocFunctionNode>): TemplateMap { - val (inherited, own) = nodes.partition { it.extras[InheritedFunction]?.isInherited ?: false } + val (inherited, own) = nodes.partition { it.extras[InheritedFunction]?.inheritedFrom?.any { + it.key.platform == Platform.jvm // TODO: REMOVE HARDCODED JVM DEPENDENCY + } ?: false } return mapOf( "own" to own.map { renderContentNodes(it) }, "inherited" to inherited.map { renderInheritedMethod(it) } diff --git a/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt b/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt index 8a31e596..45e97945 100644 --- a/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt +++ b/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt @@ -14,7 +14,6 @@ class JavadocTest : AbstractCoreTest() { pass { sourceRoots = listOf("jvmSrc/") analysisPlatform = "jvm" - targets = listOf("jvm") } } } |