Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
<li class="blockList">
<h4>{{ constructor.name }}</h4>
<pre>{{ constructor.name }}({{ constructor.inlineParameters|raw }})</pre>
<div class="block">{{ constructor.brief|raw}}</div>
<div class="block">{{ constructor.description|raw}}</div>
{% if constructor.parameters.size != 0 && hasAnyDescription(constructor.parameters) %}
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2014-2025 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

package org.jetbrains.dokka.javadoc

import org.jsoup.Jsoup
import utils.TestOutputWriterPlugin
import kotlin.test.Test
import kotlin.test.assertEquals

internal class JavadocConstructorsTest : AbstractJavadocTemplateMapTest() {
@Test
fun `should render full constructor description in constructor details section`() {
val configuration = dokkaConfiguration {
sourceSets {
sourceSet {
sourceRoots = listOf("src/main/kotlin")
classpath = listOfNotNull(jvmStdlibPath)
}
}
}
val writerPlugin = TestOutputWriterPlugin()

testInline(
"""
/src/main/kotlin/sample/TestConstructor.kt
package sample
/**
* Documentation for TestConstructor
*
* @constructor First line.
*
* Second line.
*
*/
class TestConstructor
""",
configuration = configuration,
cleanupOutput = false,
pluginOverrides = listOf(writerPlugin, JavadocPlugin()),
) {
renderingStage = { _, _ ->
val html = writerPlugin.writer.contents.getValue("sample/TestConstructor.html").let { Jsoup.parse(it) }
val constructorDetailDescription = html
.select(".details")
.select("section:first-child")
.select("div.block")
.text()
assertEquals("First line. Second line.", constructorDetailDescription)
}
}
}
}
Loading