aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-01-11 22:22:36 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-07-13 18:30:09 +0300
commitc776aaab9af80987e3c073a40f92de748dbd38ca (patch)
treee14827cc2d290c1d7bb8b0544495a31ba9328bfd /core/src/test/kotlin
parentbd30fa4c84d749976568be00307297ab015d9b2e (diff)
downloaddokka-c776aaab9af80987e3c073a40f92de748dbd38ca.tar.gz
dokka-c776aaab9af80987e3c073a40f92de748dbd38ca.tar.bz2
dokka-c776aaab9af80987e3c073a40f92de748dbd38ca.zip
[backport] Support deep inheritance with external classes
Original: 9e65c3d
Diffstat (limited to 'core/src/test/kotlin')
-rw-r--r--core/src/test/kotlin/TestAPI.kt48
-rw-r--r--core/src/test/kotlin/model/JavaTest.kt2
2 files changed, 28 insertions, 22 deletions
diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt
index aa3eff48..559b715e 100644
--- a/core/src/test/kotlin/TestAPI.kt
+++ b/core/src/test/kotlin/TestAPI.kt
@@ -6,7 +6,6 @@ import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.io.FileUtil
import com.intellij.rt.execution.junit.FileComparisonFailure
import org.jetbrains.dokka.*
-import org.jetbrains.dokka.DokkaConfiguration.SourceLinkDefinition
import org.jetbrains.dokka.Utilities.DokkaAnalysisModule
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
@@ -25,6 +24,7 @@ fun verifyModel(vararg roots: ContentRoot,
format: String = "html",
includeNonPublic: Boolean = true,
perPackageOptions: List<DokkaConfiguration.PackageOptions> = emptyList(),
+ noStdlibLink: Boolean = true,
verifier: (DocumentationModule) -> Unit) {
val documentation = DocumentationModule("test")
@@ -37,7 +37,7 @@ fun verifyModel(vararg roots: ContentRoot,
sourceLinks = listOf(),
perPackageOptions = perPackageOptions,
generateIndexPages = false,
- noStdlibLink = true,
+ noStdlibLink = noStdlibLink,
cacheRoot = "default",
languageVersion = null,
apiVersion = null
@@ -161,13 +161,15 @@ fun verifyOutput(roots: Array<ContentRoot>,
withKotlinRuntime: Boolean = false,
format: String = "html",
includeNonPublic: Boolean = true,
+ noStdlibLink: Boolean = true,
outputGenerator: (DocumentationModule, StringBuilder) -> Unit) {
verifyModel(
- *roots,
- withJdk = withJdk,
- withKotlinRuntime = withKotlinRuntime,
- format = format,
- includeNonPublic = includeNonPublic
+ *roots,
+ withJdk = withJdk,
+ withKotlinRuntime = withKotlinRuntime,
+ format = format,
+ includeNonPublic = includeNonPublic,
+ noStdlibLink = noStdlibLink
) {
verifyModelOutput(it, outputExtension, roots.first().path, outputGenerator)
}
@@ -184,21 +186,25 @@ fun verifyModelOutput(it: DocumentationModule,
assertEqualsIgnoringSeparators(expectedFile, output.toString())
}
-fun verifyOutput(path: String,
- outputExtension: String,
- withJdk: Boolean = false,
- withKotlinRuntime: Boolean = false,
- format: String = "html",
- includeNonPublic: Boolean = true,
- outputGenerator: (DocumentationModule, StringBuilder) -> Unit) {
+fun verifyOutput(
+ path: String,
+ outputExtension: String,
+ withJdk: Boolean = false,
+ withKotlinRuntime: Boolean = false,
+ format: String = "html",
+ includeNonPublic: Boolean = true,
+ noStdlibLink: Boolean = true,
+ outputGenerator: (DocumentationModule, StringBuilder) -> Unit
+) {
verifyOutput(
- arrayOf(contentRootFromPath(path)),
- outputExtension,
- withJdk,
- withKotlinRuntime,
- format,
- includeNonPublic,
- outputGenerator
+ arrayOf(contentRootFromPath(path)),
+ outputExtension,
+ withJdk,
+ withKotlinRuntime,
+ format,
+ includeNonPublic,
+ noStdlibLink,
+ outputGenerator
)
}
diff --git a/core/src/test/kotlin/model/JavaTest.kt b/core/src/test/kotlin/model/JavaTest.kt
index e6c22ee4..c2ede8f0 100644
--- a/core/src/test/kotlin/model/JavaTest.kt
+++ b/core/src/test/kotlin/model/JavaTest.kt
@@ -193,7 +193,7 @@ public class JavaTest {
@Test fun enumValues() {
verifyJavaPackageMember("testdata/java/enumValues.java") { cls ->
val superTypes = cls.details(NodeKind.Supertype)
- assertEquals(0, superTypes.size)
+ assertEquals(1, superTypes.size)
assertEquals(1, cls.members(NodeKind.EnumItem).size)
}
}