diff options
author | Marcin Aman <maman@virtuslab.com> | 2020-06-10 12:42:40 +0200 |
---|---|---|
committer | Błażej Kardyś <bkardys@virtuslab.com> | 2020-06-23 02:19:14 +0200 |
commit | 04b4c725364e33617a7607493e39308b0ba79d58 (patch) | |
tree | 6522f9e2650287731a2fed98a03f95af76a010a3 /plugins | |
parent | 8f1bc3565e85281ee242a5620496aa3aedefa9c7 (diff) | |
download | dokka-04b4c725364e33617a7607493e39308b0ba79d58.tar.gz dokka-04b4c725364e33617a7607493e39308b0ba79d58.tar.bz2 dokka-04b4c725364e33617a7607493e39308b0ba79d58.zip |
Fix tests on javadoc
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt | 3 | ||||
-rw-r--r-- | plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt index c9f4b156..5cc17bf3 100644 --- a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt +++ b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt @@ -32,8 +32,7 @@ class DokkaBasicTests : AbstractCoreTest() { ) { pagesGenerationStage = { val root = it as ModulePageNode - println(root.dri) - assertTrue(root.getClasslikeToMemberMap().filterKeys { root.name == "Test" }.entries.firstOrNull()?.value?.size == 2) + assertTrue(root.getClasslikeToMemberMap().filterKeys { it.name == "Test" }.entries.firstOrNull()?.value?.size == 2) } } } diff --git a/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt b/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt index a1bffdc2..118bc4d3 100644 --- a/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt +++ b/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt @@ -239,7 +239,7 @@ class TreeViewPage( else { listOf(node.copy(children = node.children.flatMap (::classTreeRec))) } - fun classTree(node: InheritanceNode) = classTreeRec(node).single() + fun classTree(node: InheritanceNode) = classTreeRec(node).singleOrNull() fun interfaceTreeRec(node: InheritanceNode): List<InheritanceNode> = if (node.isInterface) { listOf(node.copy(children = node.children.filter { it.isInterface })) @@ -248,7 +248,7 @@ class TreeViewPage( node.children.flatMap(::interfaceTreeRec) } - fun interfaceTree(node: InheritanceNode) = interfaceTreeRec(node).first() // TODO.single() + fun interfaceTree(node: InheritanceNode) = interfaceTreeRec(node).firstOrNull() // TODO.single() fun gatherPsiClasses(psi: PsiClass): List<Pair<PsiClass, List<PsiClass>>> = psi.supers.toList().let { l -> listOf(psi to l) + l.flatMap { gatherPsiClasses(it) } @@ -303,7 +303,7 @@ class TreeViewPage( collect(it.value.dri) } - return rootNodes.let { Pair(it.map(::classTree), it.map(::interfaceTree)) } + return rootNodes.let { Pair(it.mapNotNull(::classTree), it.mapNotNull(::interfaceTree)) } } private fun generateInterfaceGraph() { |