diff options
| author | Kamil Doległo <kamilok1965@interia.pl> | 2019-10-31 12:10:10 +0100 |
|---|---|---|
| committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-10-31 12:10:10 +0100 |
| commit | 7c30624e3d0868346823b15b5cea5e29a56357f2 (patch) | |
| tree | 5cc8175510c907d23f7bdcb5d5617ef03b587965 /core/src/test/kotlin | |
| parent | 57830827b9bc13aad7af6ab899f25b278b248ef7 (diff) | |
| download | dokka-7c30624e3d0868346823b15b5cea5e29a56357f2.tar.gz dokka-7c30624e3d0868346823b15b5cea5e29a56357f2.tar.bz2 dokka-7c30624e3d0868346823b15b5cea5e29a56357f2.zip | |
Remove all unnecessary files
Diffstat (limited to 'core/src/test/kotlin')
19 files changed, 0 insertions, 2916 deletions
diff --git a/core/src/test/kotlin/NodeSelect.kt b/core/src/test/kotlin/NodeSelect.kt deleted file mode 100644 index fe0394f9..00000000 --- a/core/src/test/kotlin/NodeSelect.kt +++ /dev/null @@ -1,90 +0,0 @@ -package org.jetbrains.dokka.tests - -import org.jetbrains.dokka.DocumentationNode -import org.jetbrains.dokka.NodeKind -import org.jetbrains.dokka.RefKind - -class SelectBuilder { - private val root = ChainFilterNode(SubgraphTraverseFilter(), null) - private var activeNode = root - private val chainEnds = mutableListOf<SelectFilter>() - - fun withName(name: String) = matching { it.name == name } - - fun withKind(kind: NodeKind) = matching{ it.kind == kind } - - fun matching(block: (DocumentationNode) -> Boolean) { - attachFilterAndMakeActive(PredicateFilter(block)) - } - - fun subgraph() { - attachFilterAndMakeActive(SubgraphTraverseFilter()) - } - - fun subgraphOf(kind: RefKind) { - attachFilterAndMakeActive(DirectEdgeFilter(kind)) - } - - private fun attachFilterAndMakeActive(next: SelectFilter) { - activeNode = ChainFilterNode(next, activeNode) - } - - private fun endChain() { - chainEnds += activeNode - } - - fun build(): SelectFilter { - endChain() - return CombineFilterNode(chainEnds) - } -} - -private class ChainFilterNode(val filter: SelectFilter, val previous: SelectFilter?): SelectFilter() { - override fun select(roots: Sequence<DocumentationNode>): Sequence<DocumentationNode> { - return filter.select(previous?.select(roots) ?: roots) - } -} - -private class CombineFilterNode(val previous: List<SelectFilter>): SelectFilter() { - override fun select(roots: Sequence<DocumentationNode>): Sequence<DocumentationNode> { - return previous.asSequence().flatMap { it.select(roots) } - } -} - -abstract class SelectFilter { - abstract fun select(roots: Sequence<DocumentationNode>): Sequence<DocumentationNode> -} - -private class SubgraphTraverseFilter: SelectFilter() { - override fun select(roots: Sequence<DocumentationNode>): Sequence<DocumentationNode> { - val visited = mutableSetOf<DocumentationNode>() - return roots.flatMap { - generateSequence(listOf(it)) { nodes -> - nodes.flatMap { it.allReferences() } - .map { it.to } - .filter { visited.add(it) } - .takeUnless { it.isEmpty() } - } - }.flatten() - } - -} - -private class PredicateFilter(val condition: (DocumentationNode) -> Boolean): SelectFilter() { - override fun select(roots: Sequence<DocumentationNode>): Sequence<DocumentationNode> { - return roots.filter(condition) - } -} - -private class DirectEdgeFilter(val kind: RefKind): SelectFilter() { - override fun select(roots: Sequence<DocumentationNode>): Sequence<DocumentationNode> { - return roots.flatMap { it.references(kind).asSequence() }.map { it.to } - } -} - - -fun selectNodes(root: DocumentationNode, block: SelectBuilder.() -> Unit): List<DocumentationNode> { - val builder = SelectBuilder() - builder.apply(block) - return builder.build().select(sequenceOf(root)).toMutableSet().toList() -}
\ No newline at end of file diff --git a/core/src/test/kotlin/format/FileGeneratorTestCase.kt b/core/src/test/kotlin/format/FileGeneratorTestCase.kt deleted file mode 100644 index ef9e815d..00000000 --- a/core/src/test/kotlin/format/FileGeneratorTestCase.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.jetbrains.dokka.tests - -import org.jetbrains.dokka.* -import org.junit.Before -import org.junit.Rule -import org.junit.rules.TemporaryFolder - - -abstract class FileGeneratorTestCase { - abstract val formatService: FormatService - - @get:Rule - var folder = TemporaryFolder() - - val fileGenerator = FileGenerator(folder.apply { create() }.root) - - @Before - fun bindGenerator() { - fileGenerator.formatService = formatService - } - - fun buildPagesAndReadInto(nodes: List<DocumentationNode>, sb: StringBuilder) = with(fileGenerator) { - buildPages(nodes) - val byLocations = nodes.groupBy { location(it) } - byLocations.forEach { (loc, _) -> - if (byLocations.size > 1) { - if (sb.isNotBlank() && !sb.endsWith('\n')) { - sb.appendln() - } - sb.appendln("<!-- File: ${loc.file.relativeTo(root).toUnixString()} -->") - } - sb.append(loc.file.readText()) - } - } -}
\ No newline at end of file diff --git a/core/src/test/kotlin/format/GFMFormatTest.kt b/core/src/test/kotlin/format/GFMFormatTest.kt deleted file mode 100644 index 4807d0f2..00000000 --- a/core/src/test/kotlin/format/GFMFormatTest.kt +++ /dev/null @@ -1,38 +0,0 @@ -package org.jetbrains.dokka.tests - -import org.jetbrains.dokka.GFMFormatService -import org.jetbrains.dokka.KotlinLanguageService -import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.testApi.ModelConfig -import org.jetbrains.dokka.testApi.verifyOutput -import org.junit.Test - -abstract class BaseGFMFormatTest(val analysisPlatform: Platform) : FileGeneratorTestCase() { - override val formatService = GFMFormatService(fileGenerator, KotlinLanguageService(), listOf()) - private val defaultModelConfig = ModelConfig(analysisPlatform = analysisPlatform) - - - @Test - fun sample() { - verifyGFMNodeByName("sample", "Foo", defaultModelConfig) - } - - @Test - fun listInTableCell() { - verifyGFMNodeByName("listInTableCell", "Foo", defaultModelConfig) - } - - private fun verifyGFMNodeByName(fileName: String, name: String, modelConfig: ModelConfig) { - verifyOutput("testdata/format/gfm/$fileName.kt", ".md", modelConfig) { model, output -> - buildPagesAndReadInto( - model.members.single().members.filter { it.name == name }, - output - ) - } - } -} - - -class JsGFMFormatTest : BaseGFMFormatTest(Platform.js) -class JvmGFMFormatTest : BaseGFMFormatTest(Platform.jvm) -class CommonGFMFormatTest : BaseGFMFormatTest(Platform.common)
\ No newline at end of file diff --git a/core/src/test/kotlin/format/HtmlFormatTest.kt b/core/src/test/kotlin/format/HtmlFormatTest.kt deleted file mode 100644 index a1742280..00000000 --- a/core/src/test/kotlin/format/HtmlFormatTest.kt +++ /dev/null @@ -1,195 +0,0 @@ -package org.jetbrains.dokka.tests - -import org.jetbrains.dokka.* -import org.jetbrains.dokka.testApi.ModelConfig -import org.jetbrains.dokka.testApi.verifyJavaOutput -import org.jetbrains.dokka.testApi.verifyOutput -import org.jetbrains.kotlin.cli.common.config.KotlinSourceRoot -import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot -import org.junit.Test -import java.io.File - -abstract class BaseHtmlFormatTest(val analysisPlatform: Platform): FileGeneratorTestCase() { - protected val defaultModelConfig = ModelConfig(analysisPlatform = analysisPlatform) - override val formatService = HtmlFormatService(fileGenerator, KotlinLanguageService(), HtmlTemplateService.default(), listOf()) - - @Test fun classWithCompanionObject() { - verifyHtmlNode("classWithCompanionObject", defaultModelConfig) - } - - @Test fun htmlEscaping() { - verifyHtmlNode("htmlEscaping", defaultModelConfig) - } - - @Test fun overloads() { - verifyHtmlNodes("overloads", defaultModelConfig) { model -> model.members } - } - - @Test fun overloadsWithDescription() { - verifyHtmlNode("overloadsWithDescription", defaultModelConfig) - } - - @Test fun overloadsWithDifferentDescriptions() { - verifyHtmlNode("overloadsWithDifferentDescriptions", defaultModelConfig) - } - - @Test fun deprecated() { - verifyOutput("testdata/format/deprecated.kt", ".package.html", defaultModelConfig) { model, output -> - buildPagesAndReadInto(model.members, output) - } - verifyOutput("testdata/format/deprecated.kt", ".class.html", defaultModelConfig) { model, output -> - buildPagesAndReadInto(model.members.single().members, output) - } - } - - @Test fun brokenLink() { - verifyHtmlNode("brokenLink", defaultModelConfig) - } - - @Test fun codeSpan() { - verifyHtmlNode("codeSpan", defaultModelConfig) - } - - @Test fun parenthesis() { - verifyHtmlNode("parenthesis", defaultModelConfig) - } - - @Test fun bracket() { - verifyHtmlNode("bracket", defaultModelConfig) - } - - @Test fun see() { - verifyHtmlNode("see", defaultModelConfig) - } - - @Test fun tripleBackticks() { - verifyHtmlNode("tripleBackticks", defaultModelConfig) - } - - @Test fun typeLink() { - verifyHtmlNodes("typeLink", defaultModelConfig) { model -> model.members.single().members.filter { it.name == "Bar" } } - } - - @Test fun parameterAnchor() { - verifyHtmlNode("parameterAnchor", defaultModelConfig) - } - - @Test fun codeBlock() { - verifyHtmlNode("codeBlock", defaultModelConfig) - } - @Test fun orderedList() { - verifyHtmlNodes("orderedList", defaultModelConfig) { model -> model.members.single().members.filter { it.name == "Bar" } } - } - - @Test fun linkWithLabel() { - verifyHtmlNodes("linkWithLabel", defaultModelConfig) { model -> model.members.single().members.filter { it.name == "Bar" } } - } - - @Test fun entity() { - verifyHtmlNodes("entity", defaultModelConfig) { model -> model.members.single().members.filter { it.name == "Bar" } } - } - - @Test fun uninterpretedEmphasisCharacters() { - verifyHtmlNode("uninterpretedEmphasisCharacters", defaultModelConfig) - } - - @Test fun markdownInLinks() { - verifyHtmlNode("markdownInLinks", defaultModelConfig) - } - - @Test fun returnWithLink() { - verifyHtmlNode("returnWithLink", defaultModelConfig) - } - - @Test fun linkWithStarProjection() { - verifyHtmlNode("linkWithStarProjection", ModelConfig(analysisPlatform = analysisPlatform, withKotlinRuntime = true)) - } - - @Test fun functionalTypeWithNamedParameters() { - verifyHtmlNode("functionalTypeWithNamedParameters", defaultModelConfig) - } - - @Test fun sinceKotlin() { - verifyHtmlNode("sinceKotlin", defaultModelConfig) - } - - @Test fun blankLineInsideCodeBlock() { - verifyHtmlNode("blankLineInsideCodeBlock", defaultModelConfig) - } - - @Test fun indentedCodeBlock() { - verifyHtmlNode("indentedCodeBlock", defaultModelConfig) - } - - private fun verifyHtmlNode(fileName: String, modelConfig: ModelConfig = ModelConfig()) { - verifyHtmlNodes(fileName, modelConfig) { model -> model.members.single().members } - } - - private fun verifyHtmlNodes(fileName: String, - modelConfig: ModelConfig = ModelConfig(), - nodeFilter: (DocumentationModule) -> List<DocumentationNode>) { - verifyOutput("testdata/format/$fileName.kt", ".html", modelConfig) { model, output -> - buildPagesAndReadInto(nodeFilter(model), output) - } - } - - protected fun verifyJavaHtmlNode(fileName: String, modelConfig: ModelConfig = ModelConfig()) { - verifyJavaHtmlNodes(fileName, modelConfig) { model -> model.members.single().members } - } - - protected fun verifyJavaHtmlNodes(fileName: String, - modelConfig: ModelConfig = ModelConfig(), - nodeFilter: (DocumentationModule) -> List<DocumentationNode>) { - verifyJavaOutput("testdata/format/$fileName.java", ".html", modelConfig) { model, output -> - buildPagesAndReadInto(nodeFilter(model), output) - } - } -} - -class JSHtmlFormatTest: BaseHtmlFormatTest(Platform.js) - -class JVMHtmlFormatTest: BaseHtmlFormatTest(Platform.jvm) { - @Test - fun javaSeeTag() { - verifyJavaHtmlNode("javaSeeTag", defaultModelConfig) - } - - @Test fun javaDeprecated() { - verifyJavaHtmlNodes("javaDeprecated", defaultModelConfig) { model -> - model.members.single().members.single { it.name == "Foo" }.members.filter { it.name == "foo" } - } - } - - @Test fun crossLanguageKotlinExtendsJava() { - verifyOutput( - ModelConfig( - roots = arrayOf( - KotlinSourceRoot("testdata/format/crossLanguage/kotlinExtendsJava/Bar.kt", false), - JavaSourceRoot(File("testdata/format/crossLanguage/kotlinExtendsJava"), null) - ), - analysisPlatform = analysisPlatform - ), ".html") { model, output -> - buildPagesAndReadInto( - model.members.single().members.filter { it.name == "Bar" }, - output - ) - } - } - - @Test fun javaLinkTag() { - verifyJavaHtmlNode("javaLinkTag", defaultModelConfig) - } - - @Test fun javaLinkTagWithLabel() { - verifyJavaHtmlNode("javaLinkTagWithLabel", defaultModelConfig) - } - - @Test fun javaSupertypeLink() { - verifyJavaHtmlNodes("JavaSupertype", defaultModelConfig) { model -> - model.members.single().members.single { it.name == "JavaSupertype" }.members.filter { it.name == "Bar" } - } - } - -} - -class CommonHtmlFormatTest: BaseHtmlFormatTest(Platform.common)
\ No newline at end of file diff --git a/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt deleted file mode 100644 index d8b34394..00000000 --- a/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt +++ /dev/null @@ -1,127 +0,0 @@ -package org.jetbrains.dokka.tests - -import org.jetbrains.dokka.* -import org.jetbrains.dokka.Generation.DocumentationMerger -import org.jetbrains.dokka.testApi.ModelConfig -import org.jetbrains.dokka.testApi.appendDocumentation -import org.jetbrains.dokka.testApi.verifyModelOutput -import org.jetbrains.dokka.testApi.verifyOutput -import org.junit.Test - -abstract class BaseKotlinWebSiteHtmlFormatTest(val analysisPlatform: Platform): FileGeneratorTestCase() { - val defaultModelConfig = ModelConfig(analysisPlatform = analysisPlatform) - override val formatService = KotlinWebsiteHtmlFormatService(fileGenerator, KotlinLanguageService(), listOf(), EmptyHtmlTemplateService) - - @Test fun dropImport() { - verifyKWSNodeByName("dropImport", "foo", defaultModelConfig) - } - - @Test fun sample() { - verifyKWSNodeByName("sample", "foo", defaultModelConfig) - } - - @Test fun sampleWithAsserts() { - verifyKWSNodeByName("sampleWithAsserts", "a", defaultModelConfig) - } - - @Test fun newLinesInSamples() { - verifyKWSNodeByName("newLinesInSamples", "foo", defaultModelConfig) - } - - @Test fun newLinesInImportList() { - verifyKWSNodeByName("newLinesInImportList", "foo", defaultModelConfig) - } - - @Test fun returnTag() { - verifyKWSNodeByName("returnTag", "indexOf", defaultModelConfig) - } - - @Test fun overloadGroup() { - verifyKWSNodeByName("overloadGroup", "magic", defaultModelConfig) - } - - @Test fun dataTags() { - val module = buildMultiplePlatforms("dataTags") - verifyMultiplatformPackage(module, "dataTags") - } - - @Test fun dataTagsInGroupNode() { - val path = "dataTagsInGroupNode" - val module = buildMultiplePlatforms(path) - verifyModelOutput(module, ".html", "testdata/format/website-html/$path/multiplatform.kt") { model, output -> - buildPagesAndReadInto( - listOfNotNull(model.members.single().members.find { it.kind == NodeKind.GroupNode }), - output - ) - } - verifyMultiplatformPackage(module, path) - } - - private fun verifyKWSNodeByName(fileName: String, name: String, modelConfig: ModelConfig) { - verifyOutput( - "testdata/format/website-html/$fileName.kt", - ".html", - ModelConfig(analysisPlatform = modelConfig.analysisPlatform, format = "kotlin-website-html") - ) { model, output -> - buildPagesAndReadInto(model.members.single().members.filter { it.name == name }, output) - } - } - - private fun buildMultiplePlatforms(path: String): DocumentationModule { - val moduleName = "test" - val passConfiguration = org.jetbrains.dokka.testApi.PassConfigurationImpl( - noStdlibLink = true, - noJdkLink = true, - languageVersion = null, - apiVersion = null - ) - - val dokkaConfiguration = org.jetbrains.dokka.testApi.DokkaConfigurationImpl( - outputDir = "", - format = "kotlin-website-html", - generateIndexPages = false, - passesConfigurations = listOf( - passConfiguration - ) - - ) - - val module1 = DocumentationModule(moduleName) - appendDocumentation( - module1, dokkaConfiguration, passConfiguration, ModelConfig( - roots = arrayOf(contentRootFromPath("testdata/format/website-html/$path/jvm.kt")), - defaultPlatforms = listOf("JVM") - ) - ) - - val module2 = DocumentationModule(moduleName) - appendDocumentation( - module2, dokkaConfiguration, passConfiguration, ModelConfig( - roots = arrayOf(contentRootFromPath("testdata/format/website-html/$path/jre7.kt")), - defaultPlatforms = listOf("JVM", "JRE7") - ) - ) - - val module3 = DocumentationModule(moduleName) - appendDocumentation( - module3, dokkaConfiguration, passConfiguration, ModelConfig( - roots = arrayOf(contentRootFromPath("testdata/format/website-html/$path/js.kt")), - defaultPlatforms = listOf("JS") - ) - ) - - return DocumentationMerger(listOf(module1, module2, module3), DokkaConsoleLogger).merge() - } - - private fun verifyMultiplatformPackage(module: DocumentationModule, path: String) { - verifyModelOutput(module, ".package.html", "testdata/format/website-html/$path/multiplatform.kt") { model, output -> - buildPagesAndReadInto(model.members, output) - } - } - -} -class JsKotlinWebSiteHtmlFormatTest: BaseKotlinWebSiteHtmlFormatTest(Platform.js) - -class JvmKotlinWebSiteHtmlFormatTest: BaseKotlinWebSiteHtmlFormatTest(Platform.jvm) - -class CommonKotlinWebSiteHtmlFormatTest: BaseKotlinWebSiteHtmlFormatTest(Platform.common)
\ No newline at end of file diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt deleted file mode 100644 index 8900b267..00000000 --- a/core/src/test/kotlin/format/MarkdownFormatTest.kt +++ /dev/null @@ -1,616 +0,0 @@ -package org.jetbrains.dokka.tests - -import org.jetbrains.dokka.* -import org.jetbrains.dokka.Generation.DocumentationMerger -import org.jetbrains.dokka.testApi.* -import org.junit.Test - -abstract class BaseMarkdownFormatTest(val analysisPlatform: Platform): FileGeneratorTestCase() { - override val formatService = MarkdownFormatService(fileGenerator, KotlinLanguageService(), listOf()) - - protected val defaultModelConfig = ModelConfig(analysisPlatform = analysisPlatform) - - @Test fun emptyDescription() { - verifyMarkdownNode("emptyDescription", defaultModelConfig) - } - - @Test fun classWithCompanionObject() { - verifyMarkdownNode("classWithCompanionObject", defaultModelConfig) - } - - @Test fun annotations() { - verifyMarkdownNode("annotations", defaultModelConfig) - } - - @Test fun annotationClass() { - verifyMarkdownNode("annotationClass", ModelConfig(analysisPlatform = analysisPlatform, withKotlinRuntime = true)) - verifyMarkdownPackage("annotationClass", ModelConfig(analysisPlatform = analysisPlatform, withKotlinRuntime = true)) - } - - @Test fun enumClass() { - verifyOutput("testdata/format/enumClass.kt", ".md", defaultModelConfig) { model, output -> - buildPagesAndReadInto(model.members.single().members, output) - } - verifyOutput("testdata/format/enumClass.kt", ".value.md", defaultModelConfig) { model, output -> - val enumClassNode = model.members.single().members[0] - buildPagesAndReadInto( - enumClassNode.members.filter { it.name == "LOCAL_CONTINUE_AND_BREAK" }, - output - ) - } - } - - @Test fun varargsFunction() { - verifyMarkdownNode("varargsFunction", defaultModelConfig) - } - - @Test fun overridingFunction() { - verifyMarkdownNodes("overridingFunction", defaultModelConfig) { model-> - val classMembers = model.members.single().members.first { it.name == "D" }.members - classMembers.filter { it.name == "f" } - } - } - - @Test fun propertyVar() { - verifyMarkdownNode("propertyVar", defaultModelConfig) - } - - @Test fun functionWithDefaultParameter() { - verifyMarkdownNode("functionWithDefaultParameter", defaultModelConfig) - } - - @Test fun accessor() { - verifyMarkdownNodes("accessor", defaultModelConfig) { model -> - model.members.single().members.first { it.name == "C" }.members.filter { it.name == "x" } - } - } - - @Test fun paramTag() { - verifyMarkdownNode("paramTag", defaultModelConfig) - } - - @Test fun throwsTag() { - verifyMarkdownNode("throwsTag", defaultModelConfig) - } - - @Test fun typeParameterBounds() { - verifyMarkdownNode("typeParameterBounds", defaultModelConfig) - } - - @Test fun typeParameterVariance() { - verifyMarkdownNode("typeParameterVariance", defaultModelConfig) - } - - @Test fun typeProjectionVariance() { - verifyMarkdownNode("typeProjectionVariance", defaultModelConfig) - } - - @Test fun codeBlockNoHtmlEscape() { - verifyMarkdownNodeByName("codeBlockNoHtmlEscape", "hackTheArithmetic", defaultModelConfig) - } - - @Test fun companionObjectExtension() { - verifyMarkdownNodeByName("companionObjectExtension", "Foo", defaultModelConfig) - } - - @Test fun starProjection() { - verifyMarkdownNode("starProjection", defaultModelConfig) - } - - @Test fun extensionFunctionParameter() { - verifyMarkdownNode("extensionFunctionParameter", defaultModelConfig) - } - - @Test fun summarizeSignatures() { - verifyMarkdownNodes("summarizeSignatures", defaultModelConfig) { model -> model.members } - } - - @Test fun reifiedTypeParameter() { - verifyMarkdownNode("reifiedTypeParameter", ModelConfig(analysisPlatform = analysisPlatform, withKotlinRuntime = true)) - } - - @Test fun suspendInlineFunctionOrder() { - verifyMarkdownNode("suspendInlineFunction", ModelConfig(analysisPlatform = analysisPlatform, withKotlinRuntime = true)) - } - - @Test fun inlineSuspendFunctionOrderChanged() { - verifyMarkdownNode("inlineSuspendFunction", ModelConfig(analysisPlatform = analysisPlatform, withKotlinRuntime = true)) - } - - @Test fun annotatedTypeParameter() { - verifyMarkdownNode("annotatedTypeParameter", ModelConfig(analysisPlatform = analysisPlatform, withKotlinRuntime = true)) - } - - @Test fun inheritedMembers() { - verifyMarkdownNodeByName("inheritedMembers", "Bar", defaultModelConfig) - } - - @Test fun inheritedExtensions() { - verifyMarkdownNodeByName("inheritedExtensions", "Bar", defaultModelConfig) - } - - @Test fun genericInheritedExtensions() { - verifyMarkdownNodeByName("genericInheritedExtensions", "Bar", defaultModelConfig) - } - - @Test fun arrayAverage() { - verifyMarkdownNodeByName("arrayAverage", "XArray", defaultModelConfig) - } - - @Test fun multipleTypeParameterConstraints() { - verifyMarkdownNode("multipleTypeParameterConstraints", ModelConfig(analysisPlatform = analysisPlatform, withKotlinRuntime = true)) - } - - @Test fun inheritedCompanionObjectProperties() { - verifyMarkdownNodeByName("inheritedCompanionObjectProperties", "C", defaultModelConfig) - } - - @Test fun shadowedExtensionFunctions() { - verifyMarkdownNodeByName("shadowedExtensionFunctions", "Bar", defaultModelConfig) - } - - @Test fun inapplicableExtensionFunctions() { - verifyMarkdownNodeByName("inapplicableExtensionFunctions", "Bar", defaultModelConfig) - } - - @Test fun receiverParameterTypeBound() { - verifyMarkdownNodeByName("receiverParameterTypeBound", "Foo", defaultModelConfig) - } - - @Test fun extensionWithDocumentedReceiver() { - verifyMarkdownNodes("extensionWithDocumentedReceiver", defaultModelConfig) { model -> - model.members.single().members.single().members.filter { it.name == "fn" } - } - } - - @Test fun codeBlock() { - verifyMarkdownNode("codeBlock", defaultModelConfig) - } - - @Test fun exclInCodeBlock() { - verifyMarkdownNodeByName("exclInCodeBlock", "foo", defaultModelConfig) - } - - @Test fun backtickInCodeBlock() { - verifyMarkdownNodeByName("backtickInCodeBlock", "foo", defaultModelConfig) - } - - @Test fun qualifiedNameLink() { - verifyMarkdownNodeByName("qualifiedNameLink", "foo", - ModelConfig(analysisPlatform = analysisPlatform, withKotlinRuntime = true)) - } - - @Test fun functionalTypeWithNamedParameters() { - verifyMarkdownNode("functionalTypeWithNamedParameters", defaultModelConfig) - } - - @Test fun typeAliases() { - verifyMarkdownNode("typeAliases", defaultModelConfig) - verifyMarkdownPackage("typeAliases", defaultModelConfig) - } - - @Test fun sampleByShortName() { - verifyMarkdownNode("sampleByShortName", defaultModelConfig) - } - - - @Test fun suspendParam() { - verifyMarkdownNode("suspendParam", defaultModelConfig) - verifyMarkdownPackage("suspendParam", defaultModelConfig) - } - - @Test fun sinceKotlin() { - verifyMarkdownNode("sinceKotlin", defaultModelConfig) - verifyMarkdownPackage("sinceKotlin", defaultModelConfig) - } - - @Test fun sinceKotlinWide() { - verifyMarkdownPackage("sinceKotlinWide", defaultModelConfig) - } - - @Test fun dynamicType() { - verifyMarkdownNode("dynamicType", defaultModelConfig) - } - - @Test fun dynamicExtension() { - verifyMarkdownNodes("dynamicExtension", defaultModelConfig) { model -> model.members.single().members.filter { it.name == "Foo" } } - } - - @Test fun memberExtension() { - verifyMarkdownNodes("memberExtension", defaultModelConfig) { model -> model.members.single().members.filter { it.name == "Foo" } } - } - - @Test fun renderFunctionalTypeInParenthesisWhenItIsReceiver() { - verifyMarkdownNode("renderFunctionalTypeInParenthesisWhenItIsReceiver", defaultModelConfig) - } - - @Test fun multiplePlatforms() { - verifyMultiplatformPackage(buildMultiplePlatforms("multiplatform/simple"), "multiplatform/simple") - } - - @Test fun multiplePlatformsMerge() { - verifyMultiplatformPackage(buildMultiplePlatforms("multiplatform/merge"), "multiplatform/merge") - } - - @Test fun multiplePlatformsMergeMembers() { - val module = buildMultiplePlatforms("multiplatform/mergeMembers") - verifyModelOutput(module, ".md", "testdata/format/multiplatform/mergeMembers/foo.kt") { model, output -> - buildPagesAndReadInto(model.members.single().members, output) - } - } - - @Test fun multiplePlatformsOmitRedundant() { - val module = buildMultiplePlatforms("multiplatform/omitRedundant") - verifyModelOutput(module, ".md", "testdata/format/multiplatform/omitRedundant/foo.kt") { model, output -> - buildPagesAndReadInto(model.members.single().members, output) - } - } - - @Test fun multiplePlatformsImplied() { - val module = buildMultiplePlatforms("multiplatform/implied") - verifyModelOutput(module, ".md", "testdata/format/multiplatform/implied/foo.kt") { model, output -> - val service = MarkdownFormatService(fileGenerator, KotlinLanguageService(), listOf("JVM", "JS")) - fileGenerator.formatService = service - buildPagesAndReadInto(model.members.single().members, output) - } - } - - @Test fun packagePlatformsWithExtExtensions() { - val path = "multiplatform/packagePlatformsWithExtExtensions" - val module = DocumentationModule("test") - val passConfiguration = org.jetbrains.dokka.testApi.PassConfigurationImpl( - noStdlibLink = true, - noJdkLink = true, - languageVersion = null, - apiVersion = null - ) - - val dokkaConfiguration = org.jetbrains.dokka.testApi.DokkaConfigurationImpl( - outputDir = "", - format = "html", - generateIndexPages = false, - passesConfigurations = listOf( - passConfiguration - ) - ) - - appendDocumentation(module, dokkaConfiguration, passConfiguration, ModelConfig( - roots = arrayOf(contentRootFromPath("testdata/format/$path/jvm.kt")), - defaultPlatforms = listOf("JVM"), - withKotlinRuntime = true, - analysisPlatform = analysisPlatform - ) - ) - verifyMultiplatformIndex(module, path) - verifyMultiplatformPackage(module, path) - } - - @Test fun multiplePlatformsPackagePlatformFromMembers() { - val path = "multiplatform/packagePlatformsFromMembers" - val module = buildMultiplePlatforms(path) - verifyMultiplatformIndex(module, path) - verifyMultiplatformPackage(module, path) - } - - @Test fun multiplePlatformsGroupNode() { - val path = "multiplatform/groupNode" - val module = buildMultiplePlatforms(path) - verifyModelOutput(module, ".md", "testdata/format/$path/multiplatform.kt") { model, output -> - buildPagesAndReadInto( - listOfNotNull(model.members.single().members.find { it.kind == NodeKind.GroupNode }), - output - ) - } - verifyMultiplatformPackage(module, path) - } - - @Test fun multiplePlatformsBreadcrumbsInMemberOfMemberOfGroupNode() { - val path = "multiplatform/breadcrumbsInMemberOfMemberOfGroupNode" - val module = buildMultiplePlatforms(path) - verifyModelOutput(module, ".md", "testdata/format/$path/multiplatform.kt") { model, output -> - buildPagesAndReadInto( - listOfNotNull(model.members.single().members.find { it.kind == NodeKind.GroupNode }?.member(NodeKind.Function)), - |
