aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/kotlin')
-rw-r--r--core/src/test/kotlin/TestAPI.kt56
-rw-r--r--core/src/test/kotlin/format/GFMFormatTest.kt2
-rw-r--r--core/src/test/kotlin/format/HtmlFormatTest.kt10
-rw-r--r--core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt36
-rw-r--r--core/src/test/kotlin/format/KotlinWebSiteRunnableSamplesFormatTest.kt10
-rw-r--r--core/src/test/kotlin/format/MarkdownFormatTest.kt127
-rw-r--r--core/src/test/kotlin/javadoc/JavadocTest.kt19
-rw-r--r--core/src/test/kotlin/model/ClassTest.kt12
-rw-r--r--core/src/test/kotlin/model/CommentTest.kt7
-rw-r--r--core/src/test/kotlin/model/FunctionTest.kt12
-rw-r--r--core/src/test/kotlin/model/PropertyTest.kt12
-rw-r--r--core/src/test/kotlin/model/TypeAliasTest.kt9
12 files changed, 276 insertions, 36 deletions
diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt
index 7197d2c4..19eb29d5 100644
--- a/core/src/test/kotlin/TestAPI.kt
+++ b/core/src/test/kotlin/TestAPI.kt
@@ -5,13 +5,14 @@ import com.intellij.openapi.application.PathManager
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.io.FileUtil
import org.jetbrains.dokka.*
-import org.jetbrains.dokka.Utilities.DokkaModule
+import org.jetbrains.dokka.Utilities.DokkaAnalysisModule
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot
import org.jetbrains.kotlin.config.ContentRoot
import org.jetbrains.kotlin.config.KotlinSourceRoot
+import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.junit.Assert
import org.junit.Assert.fail
import java.io.File
@@ -22,6 +23,30 @@ fun verifyModel(vararg roots: ContentRoot,
format: String = "html",
includeNonPublic: Boolean = true,
verifier: (DocumentationModule) -> Unit) {
+ val documentation = DocumentationModule("test")
+
+ val options = DocumentationOptions("", format,
+ includeNonPublic = includeNonPublic,
+ skipEmptyPackages = false,
+ includeRootPackage = true,
+ sourceLinks = listOf<SourceLinkDefinition>(),
+ generateIndexPages = false)
+
+ appendDocumentation(documentation, *roots,
+ withJdk = withJdk,
+ withKotlinRuntime = withKotlinRuntime,
+ options = options)
+ documentation.prepareForGeneration(options)
+
+ verifier(documentation)
+}
+
+fun appendDocumentation(documentation: DocumentationModule,
+ vararg roots: ContentRoot,
+ withJdk: Boolean = false,
+ withKotlinRuntime: Boolean = false,
+ options: DocumentationOptions,
+ defaultPlatforms: List<String> = emptyList()) {
val messageCollector = object : MessageCollector {
override fun clear() {
@@ -60,14 +85,12 @@ fun verifyModel(vararg roots: ContentRoot,
}
addRoots(roots.toList())
}
- val options = DocumentationOptions("", format,
- includeNonPublic = includeNonPublic,
- skipEmptyPackages = false,
- sourceLinks = listOf<SourceLinkDefinition>(),
- generateIndexPages = false)
- val injector = Guice.createInjector(DokkaModule(environment, options, DokkaConsoleLogger))
- val documentation = buildDocumentationModule(injector, "test")
- verifier(documentation)
+ val defaultPlatformsProvider = object : DefaultPlatformsProvider {
+ override fun getDefaultPlatforms(descriptor: DeclarationDescriptor) = defaultPlatforms
+ }
+ val injector = Guice.createInjector(
+ DokkaAnalysisModule(environment, options, defaultPlatformsProvider, documentation.nodeRefGraph, DokkaConsoleLogger))
+ buildDocumentationModule(injector, documentation)
Disposer.dispose(environment)
}
@@ -128,19 +151,18 @@ fun verifyOutput(roots: Array<ContentRoot>,
format: String = "html",
outputGenerator: (DocumentationModule, StringBuilder) -> Unit) {
verifyModel(*roots, withJdk = withJdk, withKotlinRuntime = withKotlinRuntime, format = format) {
- verifyModelOutput(it, outputExtension, outputGenerator, roots.first().path)
+ verifyModelOutput(it, outputExtension, roots.first().path, outputGenerator)
}
}
-private fun verifyModelOutput(it: DocumentationModule,
- outputExtension: String,
- outputGenerator: (DocumentationModule, StringBuilder) -> Unit,
- sourcePath: String) {
+fun verifyModelOutput(it: DocumentationModule,
+ outputExtension: String,
+ sourcePath: String,
+ outputGenerator: (DocumentationModule, StringBuilder) -> Unit) {
val output = StringBuilder()
outputGenerator(it, output)
val ext = outputExtension.removePrefix(".")
- val path = sourcePath
- val expectedOutput = File(path.replaceAfterLast(".", ext, path + "." + ext)).readText()
+ val expectedOutput = File(sourcePath.replaceAfterLast(".", ext, sourcePath + "." + ext)).readText()
assertEqualsIgnoringSeparators(expectedOutput, output.toString())
}
@@ -158,7 +180,7 @@ fun verifyJavaOutput(path: String,
withKotlinRuntime: Boolean = false,
outputGenerator: (DocumentationModule, StringBuilder) -> Unit) {
verifyJavaModel(path, withKotlinRuntime) { model ->
- verifyModelOutput(model, outputExtension, outputGenerator, path)
+ verifyModelOutput(model, outputExtension, path, outputGenerator)
}
}
diff --git a/core/src/test/kotlin/format/GFMFormatTest.kt b/core/src/test/kotlin/format/GFMFormatTest.kt
index 5327c9dc..c097c5c8 100644
--- a/core/src/test/kotlin/format/GFMFormatTest.kt
+++ b/core/src/test/kotlin/format/GFMFormatTest.kt
@@ -5,7 +5,7 @@ import org.jetbrains.dokka.KotlinLanguageService
import org.junit.Test
class GFMFormatTest {
- private val gfmService = GFMFormatService(InMemoryLocationService, KotlinLanguageService())
+ private val gfmService = GFMFormatService(InMemoryLocationService, KotlinLanguageService(), listOf())
@Test fun sample() {
verifyGFMNodeByName("sample", "Foo")
diff --git a/core/src/test/kotlin/format/HtmlFormatTest.kt b/core/src/test/kotlin/format/HtmlFormatTest.kt
index 4b4eff59..cbea3209 100644
--- a/core/src/test/kotlin/format/HtmlFormatTest.kt
+++ b/core/src/test/kotlin/format/HtmlFormatTest.kt
@@ -7,7 +7,7 @@ import org.junit.Test
import java.io.File
class HtmlFormatTest {
- private val htmlService = HtmlFormatService(InMemoryLocationService, KotlinLanguageService(), HtmlTemplateService.default())
+ private val htmlService = HtmlFormatService(InMemoryLocationService, KotlinLanguageService(), HtmlTemplateService.default(), listOf())
@Test fun classWithCompanionObject() {
verifyHtmlNode("classWithCompanionObject")
@@ -138,6 +138,14 @@ class HtmlFormatTest {
verifyHtmlNode("functionalTypeWithNamedParameters")
}
+ @Test fun sinceKotlin() {
+ verifyHtmlNode("sinceKotlin")
+ }
+
+ @Test fun blankLineInsideCodeBlock() {
+ verifyHtmlNode("blankLineInsideCodeBlock")
+ }
+
private fun verifyHtmlNode(fileName: String, withKotlinRuntime: Boolean = false) {
verifyHtmlNodes(fileName, withKotlinRuntime) { model -> model.members.single().members }
}
diff --git a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt
index 3363b0a3..9565263f 100644
--- a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt
+++ b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt
@@ -1,11 +1,11 @@
package org.jetbrains.dokka.tests
-import org.jetbrains.dokka.KotlinLanguageService
-import org.jetbrains.dokka.KotlinWebsiteFormatService
+import org.jetbrains.dokka.*
+import org.jetbrains.kotlin.utils.addToStdlib.singletonOrEmptyList
import org.junit.Test
class KotlinWebSiteFormatTest {
- private val kwsService = KotlinWebsiteFormatService(InMemoryLocationService, KotlinLanguageService())
+ private val kwsService = KotlinWebsiteFormatService(InMemoryLocationService, KotlinLanguageService(), listOf())
@Test fun sample() {
verifyKWSNodeByName("sample", "foo")
@@ -19,9 +19,39 @@ class KotlinWebSiteFormatTest {
verifyKWSNodeByName("overloadGroup", "magic")
}
+ @Test fun dataTags() {
+ val module = buildMultiplePlatforms("dataTags")
+ verifyMultiplatformPackage(module, "dataTags")
+ }
+
+ @Test fun dataTagsInGroupNode() {
+ val path = "dataTagsInGroupNode"
+ val module = buildMultiplePlatforms(path)
+ verifyModelOutput(module, ".md", "testdata/format/website/$path/multiplatform.kt") { model, output ->
+ kwsService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members.find { it.kind == NodeKind.GroupNode }.singletonOrEmptyList())
+ }
+ verifyMultiplatformPackage(module, path)
+ }
+
private fun verifyKWSNodeByName(fileName: String, name: String) {
verifyOutput("testdata/format/website/$fileName.kt", ".md", format = "kotlin-website") { model, output ->
kwsService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members.filter { it.name == name })
}
}
+
+ private fun buildMultiplePlatforms(path: String): DocumentationModule {
+ val module = DocumentationModule("test")
+ val options = DocumentationOptions("", "html", generateIndexPages = false)
+ appendDocumentation(module, contentRootFromPath("testdata/format/website/$path/jvm.kt"), defaultPlatforms = listOf("JVM"), options = options)
+ appendDocumentation(module, contentRootFromPath("testdata/format/website/$path/jre7.kt"), defaultPlatforms = listOf("JVM", "JRE7"), options = options)
+ appendDocumentation(module, contentRootFromPath("testdata/format/website/$path/js.kt"), defaultPlatforms = listOf("JS"), options = options)
+ return module
+ }
+
+ private fun verifyMultiplatformPackage(module: DocumentationModule, path: String) {
+ verifyModelOutput(module, ".package.md", "testdata/format/website/$path/multiplatform.kt") { model, output ->
+ kwsService.createOutputBuilder(output, tempLocation).appendNodes(model.members)
+ }
+ }
+
}
diff --git a/core/src/test/kotlin/format/KotlinWebSiteRunnableSamplesFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteRunnableSamplesFormatTest.kt
index 742d2908..0d586814 100644
--- a/core/src/test/kotlin/format/KotlinWebSiteRunnableSamplesFormatTest.kt
+++ b/core/src/test/kotlin/format/KotlinWebSiteRunnableSamplesFormatTest.kt
@@ -5,7 +5,7 @@ import org.jetbrains.dokka.KotlinWebsiteRunnableSamplesFormatService
import org.junit.Test
class KotlinWebSiteRunnableSamplesFormatTest {
- private val kwsService = KotlinWebsiteRunnableSamplesFormatService(InMemoryLocationService, KotlinLanguageService())
+ private val kwsService = KotlinWebsiteRunnableSamplesFormatService(InMemoryLocationService, KotlinLanguageService(), listOf())
@Test fun dropImport() {
@@ -20,6 +20,14 @@ class KotlinWebSiteRunnableSamplesFormatTest {
verifyKWSNodeByName("sampleWithAsserts", "a")
}
+ @Test fun newLinesInSamples() {
+ verifyKWSNodeByName("newLinesInSamples", "foo")
+ }
+
+ @Test fun newLinesInImportList() {
+ verifyKWSNodeByName("newLinesInImportList", "foo")
+ }
+
private fun verifyKWSNodeByName(fileName: String, name: String) {
verifyOutput("testdata/format/website-samples/$fileName.kt", ".md", format = "kotlin-website-samples") { model, output ->
kwsService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members.filter { it.name == name })
diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt
index 4f32fa53..21298520 100644
--- a/core/src/test/kotlin/format/MarkdownFormatTest.kt
+++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt
@@ -1,14 +1,11 @@
package org.jetbrains.dokka.tests
-import org.jetbrains.dokka.DocumentationModule
-import org.jetbrains.dokka.DocumentationNode
-import org.jetbrains.dokka.KotlinLanguageService
-import org.jetbrains.dokka.MarkdownFormatService
-import org.junit.Ignore
+import org.jetbrains.dokka.*
+import org.jetbrains.kotlin.utils.addToStdlib.singletonOrEmptyList
import org.junit.Test
class MarkdownFormatTest {
- private val markdownService = MarkdownFormatService(InMemoryLocationService, KotlinLanguageService())
+ private val markdownService = MarkdownFormatService(InMemoryLocationService, KotlinLanguageService(), listOf())
@Test fun emptyDescription() {
verifyMarkdownNode("emptyDescription")
@@ -244,6 +241,124 @@ class MarkdownFormatTest {
verifyMarkdownNode("sampleByShortName")
}
+
+ @Test fun suspendParam() {
+ verifyMarkdownNode("suspendParam")
+ verifyMarkdownPackage("suspendParam")
+ }
+
+ @Test fun sinceKotlin() {
+ verifyMarkdownNode("sinceKotlin")
+ verifyMarkdownPackage("sinceKotlin")
+ }
+
+ @Test fun dynamicType() {
+ verifyMarkdownNode("dynamicType")
+ }
+
+ @Test fun dynamicExtension() {
+ verifyMarkdownNodes("dynamicExtension") { model -> model.members.single().members.filter { it.name == "Foo" } }
+ }
+
+ @Test fun memberExtension() {
+ verifyMarkdownNodes("memberExtension") { model -> model.members.single().members.filter { it.name == "Foo" } }
+ }
+
+ @Test fun renderFunctionalTypeInParenthesisWhenItIsReceiver() {
+ verifyMarkdownNode("renderFunctionalTypeInParenthesisWhenItIsReceiver")
+ }
+
+ @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 ->
+ markdownService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members)
+ }
+ }
+
+ @Test fun multiplePlatformsOmitRedundant() {
+ val module = buildMultiplePlatforms("multiplatform/omitRedundant")
+ verifyModelOutput(module, ".md", "testdata/format/multiplatform/omitRedundant/foo.kt") { model, output ->
+ markdownService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members)
+ }
+ }
+
+ @Test fun multiplePlatformsImplied() {
+ val module = buildMultiplePlatforms("multiplatform/implied")
+ verifyModelOutput(module, ".md", "testdata/format/multiplatform/implied/foo.kt") { model, output ->
+ MarkdownFormatService(InMemoryLocationService, KotlinLanguageService(), listOf("JVM", "JS"))
+ .createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members)
+ }
+ }
+
+ @Test fun packagePlatformsWithExtExtensions() {
+ val path = "multiplatform/packagePlatformsWithExtExtensions"
+ val module = DocumentationModule("test")
+ val options = DocumentationOptions("", "html", generateIndexPages = false)
+ appendDocumentation(module, contentRootFromPath("testdata/format/$path/jvm.kt"), defaultPlatforms = listOf("JVM"), withKotlinRuntime = true, options = options)
+ 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 ->
+ markdownService.createOutputBuilder(output, tempLocation)
+ .appendNodes(listOfNotNull(model.members.single().members.find { it.kind == NodeKind.GroupNode }))
+ }
+ verifyMultiplatformPackage(module, path)
+ }
+
+ @Test fun multiplePlatformsBreadcrumbsInMemberOfMemberOfGroupNode() {
+ val path = "multiplatform/breadcrumbsInMemberOfMemberOfGroupNode"
+ val module = buildMultiplePlatforms(path)
+ verifyModelOutput(module, ".md", "testdata/format/$path/multiplatform.kt") { model, output ->
+ markdownService.createOutputBuilder(output, tempLocation)
+ .appendNodes(listOfNotNull(model.members.single().members.find { it.kind == NodeKind.GroupNode }?.member(NodeKind.Class)?.member(NodeKind.Function)))
+ }
+ }
+
+ private fun buildMultiplePlatforms(path: String): DocumentationModule {
+ val module = DocumentationModule("test")
+ val options = DocumentationOptions("", "html", generateIndexPages = false)
+ appendDocumentation(module, contentRootFromPath("testdata/format/$path/jvm.kt"), defaultPlatforms = listOf("JVM"), options = options)
+ appendDocumentation(module, contentRootFromPath("testdata/format/$path/js.kt"), defaultPlatforms = listOf("JS"), options = options)
+ return module
+ }
+
+ private fun verifyMultiplatformPackage(module: DocumentationModule, path: String) {
+ verifyModelOutput(module, ".package.md", "testdata/format/$path/multiplatform.kt") { model, output ->
+ markdownService.createOutputBuilder(output, tempLocation).appendNodes(model.members)
+ }
+ }
+
+ private fun verifyMultiplatformIndex(module: DocumentationModule, path: String) {
+ verifyModelOutput(module, ".md", "testdata/format/$path/multiplatform.index.kt") {
+ model, output ->
+ MarkdownFormatService(InMemoryLocationService, KotlinLanguageService(), listOf())
+ .createOutputBuilder(output, tempLocation).appendNodes(listOf(model))
+ }
+ }
+
+ @Test fun blankLineInsideCodeBlock() {
+ verifyMarkdownNode("blankLineInsideCodeBlock")
+ }
+
private fun verifyMarkdownPackage(fileName: String, withKotlinRuntime: Boolean = false) {
verifyOutput("testdata/format/$fileName.kt", ".package.md", withKotlinRuntime = withKotlinRuntime) { model, output ->
markdownService.createOutputBuilder(output, tempLocation).appendNodes(model.members)
diff --git a/core/src/test/kotlin/javadoc/JavadocTest.kt b/core/src/test/kotlin/javadoc/JavadocTest.kt
index f7f86881..359c5fef 100644
--- a/core/src/test/kotlin/javadoc/JavadocTest.kt
+++ b/core/src/test/kotlin/javadoc/JavadocTest.kt
@@ -1,7 +1,9 @@
package org.jetbrains.dokka.javadoc
+import com.sun.javadoc.Tag
import com.sun.javadoc.Type
import org.jetbrains.dokka.DokkaConsoleLogger
+import org.jetbrains.dokka.tests.assertEqualsIgnoringSeparators
import org.jetbrains.dokka.tests.verifyModel
import org.junit.Assert.*
import org.junit.Test
@@ -132,6 +134,23 @@ class JavadocTest {
}
}
+ @Test
+ fun testBlankLineInsideCodeBlock() {
+ verifyJavadoc("testdata/javadoc/blankLineInsideCodeBlock.kt", withKotlinRuntime = true) { doc ->
+ val method = doc.classNamed("BlankLineInsideCodeBlockKt")!!.methods()[0]
+ val text = method.inlineTags().joinToString(separator = "", transform = Tag::text)
+ assertEqualsIgnoringSeparators("""
+ <p><code><pre>
+ This is a test
+ of Dokka's code blocks.
+ Here is a blank line.
+
+ The previous line was blank.
+ </pre></code></p>
+ """.trimIndent(), text)
+ }
+ }
+
private fun verifyJavadoc(name: String,
withJdk: Boolean = false,
withKotlinRuntime: Boolean = false,
diff --git a/core/src/test/kotlin/model/ClassTest.kt b/core/src/test/kotlin/model/ClassTest.kt
index d50a3624..fb225728 100644
--- a/core/src/test/kotlin/model/ClassTest.kt
+++ b/core/src/test/kotlin/model/ClassTest.kt
@@ -3,11 +3,11 @@ package org.jetbrains.dokka.tests
import org.jetbrains.dokka.Content
import org.jetbrains.dokka.NodeKind
import org.jetbrains.dokka.RefKind
-import org.junit.Test
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
+import org.junit.Test
-public class ClassTest {
+class ClassTest {
@Test fun emptyClass() {
verifyModel("testdata/classes/emptyClass.kt") { model ->
with(model.members.single().members.single()) {
@@ -272,4 +272,12 @@ public class ClassTest {
}
}
}
+
+ @Test fun sinceKotlin() {
+ verifyModel("testdata/classes/sinceKotlin.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(listOf("Kotlin 1.1"), platforms)
+ }
+ }
+ }
}
diff --git a/core/src/test/kotlin/model/CommentTest.kt b/core/src/test/kotlin/model/CommentTest.kt
index 25fea48d..3752bb8c 100644
--- a/core/src/test/kotlin/model/CommentTest.kt
+++ b/core/src/test/kotlin/model/CommentTest.kt
@@ -10,14 +10,18 @@ public class CommentTest {
verifyModel("testdata/comments/codeBlockComment.kt") { model ->
with(model.members.single().members.first()) {
assertEqualsIgnoringSeparators("""[code lang=brainfuck]
+ |
|++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
+ |
|[/code]
|""".trimMargin(),
content.toTestString())
}
with(model.members.single().members.last()) {
assertEqualsIgnoringSeparators("""[code]
+ |
|a + b - c
+ |
|[/code]
|""".trimMargin(),
content.toTestString())
@@ -153,7 +157,8 @@ line two""", toTestString())
with(model.members.single().members.first()) {
assertEquals("Summary", content.summary.toTestString())
with (content.description) {
- assertEqualsIgnoringSeparators("""[code lang=kotlin]
+ assertEqualsIgnoringSeparators("""
+ |[code lang=kotlin]
|if (true) {
| println(property)
|}
diff --git a/core/src/test/kotlin/model/FunctionTest.kt b/core/src/test/kotlin/model/FunctionTest.kt
index 4cced562..ddd33941 100644
--- a/core/src/test/kotlin/model/FunctionTest.kt
+++ b/core/src/test/kotlin/model/FunctionTest.kt
@@ -2,11 +2,11 @@ package org.jetbrains.dokka.tests
import org.jetbrains.dokka.Content
import org.jetbrains.dokka.NodeKind
-import org.junit.Test
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
+import org.junit.Test
-public class FunctionTest {
+class FunctionTest {
@Test fun function() {
verifyModel("testdata/functions/function.kt") { model ->
with(model.members.single().members.single()) {
@@ -224,4 +224,12 @@ Documentation""", content.description.toTestString())
}
}
}
+
+ @Test fun sinceKotlin() {
+ verifyModel("testdata/functions/sinceKotlin.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(listOf("Kotlin 1.1"), platforms)
+ }
+ }
+ }
}
diff --git a/core/src/test/kotlin/model/PropertyTest.kt b/core/src/test/kotlin/model/PropertyTest.kt
index cdf44c03..0ee0e0f5 100644
--- a/core/src/test/kotlin/model/PropertyTest.kt
+++ b/core/src/test/kotlin/model/PropertyTest.kt
@@ -3,11 +3,11 @@ package org.jetbrains.dokka.tests
import org.jetbrains.dokka.Content
import org.jetbrains.dokka.NodeKind
import org.jetbrains.dokka.RefKind
-import org.junit.Test
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
+import org.junit.Test
-public class PropertyTest {
+class PropertyTest {
@Test fun valueProperty() {
verifyModel("testdata/properties/valueProperty.kt") { model ->
with(model.members.single().members.single()) {
@@ -100,4 +100,12 @@ public class PropertyTest {
}
}
}
+
+ @Test fun sinceKotlin() {
+ verifyModel("testdata/properties/sinceKotlin.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(listOf("Kotlin 1.1"), platforms)
+ }
+ }
+ }
}
diff --git a/core/src/test/kotlin/model/TypeAliasTest.kt b/core/src/test/kotlin/model/TypeAliasTest.kt
index 812fd9dc..c653ac83 100644
--- a/core/src/test/kotlin/model/TypeAliasTest.kt
+++ b/core/src/test/kotlin/model/TypeAliasTest.kt
@@ -120,4 +120,13 @@ class TypeAliasTest {
}
}
}
+
+ @Test
+ fun sinceKotlin() {
+ verifyModel("testdata/typealias/sinceKotlin.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(listOf("Kotlin 1.1"), platforms)
+ }
+ }
+ }
} \ No newline at end of file