aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin
diff options
context:
space:
mode:
authorAndrey Tyrin <tyrin.andrew@gmail.com>2022-08-10 17:43:33 +0300
committerGitHub <noreply@github.com>2022-08-10 16:43:33 +0200
commit732f8aac1eb6b2c137fdf81d9d670a30d0f8b9ea (patch)
tree5cfe56adbc45ac4672304efb924e248c34a7e154 /plugins/base/src/test/kotlin
parentd3ff6297c4034bbf45f4a60e287e12cfa1f0ad1a (diff)
downloaddokka-732f8aac1eb6b2c137fdf81d9d670a30d0f8b9ea.tar.gz
dokka-732f8aac1eb6b2c137fdf81d9d670a30d0f8b9ea.tar.bz2
dokka-732f8aac1eb6b2c137fdf81d9d670a30d0f8b9ea.zip
Support Var html tag for Javadoc (#2617)
Fixes #2358
Diffstat (limited to 'plugins/base/src/test/kotlin')
-rw-r--r--plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt32
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/TextStylesTest.kt12
2 files changed, 44 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
index 4f37923b..af8dbb94 100644
--- a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
+++ b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
@@ -396,4 +396,36 @@ class JavadocParserTest : BaseAbstractTest() {
}
}
}
+
+ @Test
+ fun `var tag is handled properly`() {
+ val source = """
+ |/src/main/kotlin/test/Test.java
+ |package example
+ |
+ | /**
+ | * An example of using var tag: <var>variable</var>
+ | */
+ | public class Test {}
+ """.trimIndent()
+ testInline(
+ source,
+ configuration,
+ ) {
+ documentablesCreationStage = { modules ->
+ val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val root = docs.children.first().root
+
+ kotlin.test.assertEquals(
+ listOf(
+ P(children = listOf(
+ Text("An example of using var tag: "),
+ Var(children = listOf(Text("variable"))),
+ )),
+ ),
+ root.children
+ )
+ }
+ }
+ }
}
diff --git a/plugins/base/src/test/kotlin/renderers/html/TextStylesTest.kt b/plugins/base/src/test/kotlin/renderers/html/TextStylesTest.kt
index 2c862525..98f73ffa 100644
--- a/plugins/base/src/test/kotlin/renderers/html/TextStylesTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/TextStylesTest.kt
@@ -80,6 +80,18 @@ class TextStylesTest : HtmlRenderingOnlyTestBase() {
renderedContent.match(BlockQuote("blockquote text"))
}
+ @Test
+ fun `should include var`() {
+ val page = testPage {
+ group(styles = setOf(TextStyle.Var)) {
+ text("variable")
+ }
+ }
+ HtmlRenderer(context).render(page)
+ println(renderedContent)
+ renderedContent.match(Var("variable"))
+ }
+
override val renderedContent: Element
get() = files.contents.getValue("test-page.html").let { Jsoup.parse(it) }.select("#content").single()
} \ No newline at end of file