From 3994c42f2f2366d2e551e62412518a210581cb3a Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Wed, 3 Aug 2022 13:51:50 +0200 Subject: Apply the same style to all KDoc tags, including throws/see/parameters (#2587) --- .../content/seealso/ContentForSeeAlsoTest.kt | 78 ++++++++++++++++++---- 1 file changed, 65 insertions(+), 13 deletions(-) (limited to 'plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt') diff --git a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt index 4096640a..5c1fd054 100644 --- a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt +++ b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt @@ -97,13 +97,12 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { ) } after { - header(2) { +"See also" } + header(4) { +"See also" } group { table { group { //DRI should be "test//abc/#/-1/" link { +"abc" } - group { } } } } @@ -150,7 +149,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { ) } after { - header(2) { +"See also" } + header(4) { +"See also" } group { table { group { @@ -170,6 +169,60 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { } } + @Test + fun `should use fully qualified name for unresolved link`() { + testInline( + """ + |/src/main/kotlin/test/source.kt + |package test + | /** + | * @see com.example.NonExistingClass description for non-existing + | */ + |fun function(abc: String) { + | println(abc) + |} + """.trimIndent(), testConfiguration + ) { + pagesTransformationStage = { module -> + val page = module.children.single { it.name == "test" } + .children.single { it.name == "function" } as ContentPage + page.content.assertNode { + group { + header(1) { +"function" } + } + divergentGroup { + divergentInstance { + divergent { + bareSignature( + emptyMap(), + "", + "", + emptySet(), + "function", + null, + "abc" to ParamAttributes(emptyMap(), emptySet(), "String") + ) + } + after { + header(4) { +"See also" } + group { + table { + group { + +"com.example.NonExistingClass" + group { + group { +"description for non-existing" } + } + } + } + } + } + } + } + } + } + } + } + @Test fun `undocumented seealso with stdlib link`() { testInline( @@ -205,7 +258,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { ) } after { - header(2) { +"See also" } + header(4) { +"See also" } group { table { group { @@ -216,9 +269,8 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { (this as ContentDRILink).address.toString() ) } - +"kotlin.collections.Collection" + +"Collection" } - group { } } } } @@ -265,12 +317,12 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { ) } after { - header(2) { +"See also" } + header(4) { +"See also" } group { table { group { //DRI should be "test//abc/#/-1/" - link { +"kotlin.collections.Collection" } + link { +"Collection" } group { group { +"Comment to stdliblink" } } @@ -327,12 +379,12 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { unnamedTag("Author") { comment { +"pikinier20" } } unnamedTag("Since") { comment { +"0.11" } } - header(2) { +"See also" } + header(4) { +"See also" } group { table { group { //DRI should be "test//abc/#/-1/" - link { +"kotlin.collections.Collection" } + link { +"Collection" } group { group { +"Comment to stdliblink" } } @@ -383,7 +435,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { ) } after { - header(2) { +"See also" } + header(4) { +"See also" } group { table { group { @@ -439,7 +491,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { ) } after { - header(2) { +"See also" } + header(4) { +"See also" } group { table { group { @@ -451,7 +503,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { } group { //DRI should be "test//abc/#/-1/" - link { +"kotlin.collections.Collection" } + link { +"Collection" } group { group { +"Comment to collection" } } } } -- cgit