diff options
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r-- | plugins/base/src/test/kotlin/enums/EnumsTest.kt | 1 | ||||
-rw-r--r-- | plugins/base/src/test/kotlin/signatures/SignatureTest.kt | 37 |
2 files changed, 37 insertions, 1 deletions
diff --git a/plugins/base/src/test/kotlin/enums/EnumsTest.kt b/plugins/base/src/test/kotlin/enums/EnumsTest.kt index 778125e2..ee4de696 100644 --- a/plugins/base/src/test/kotlin/enums/EnumsTest.kt +++ b/plugins/base/src/test/kotlin/enums/EnumsTest.kt @@ -400,7 +400,6 @@ class EnumsTest : BaseAbstractTest() { group { group { link { +"E1" } - +"()" } } group { diff --git a/plugins/base/src/test/kotlin/signatures/SignatureTest.kt b/plugins/base/src/test/kotlin/signatures/SignatureTest.kt index 6f4de32b..c290846e 100644 --- a/plugins/base/src/test/kotlin/signatures/SignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/SignatureTest.kt @@ -857,4 +857,41 @@ class SignatureTest : BaseAbstractTest() { } } } + + @Test + fun `should have no empty parentheses for no-arg enum entry`() { + val writerPlugin = TestOutputWriterPlugin() + + testInline( + """ + |/src/main/kotlin/common/EnumClass.kt + |package example + | + |enum class EnumClass(param: String = "Default") { + | EMPTY, + | WITH_ARG("arg") + |} + """.trimMargin(), + configuration, + pluginOverrides = listOf(writerPlugin) + ) { + renderingStage = { _, _ -> + val enumEntrySignatures = writerPlugin.writer.renderedContent("root/example/-enum-class/index.html") + .select("div.table[data-togglable=Entries]") + .single() + .signature() + .select("div.block") + + enumEntrySignatures[0].match( + A("EMPTY"), + ignoreSpanWithTokenStyle = true + ) + + enumEntrySignatures[1].match( + A("WITH_ARG"), "(\"arg\")", + ignoreSpanWithTokenStyle = true + ) + } + } + } } |