From cacdcd9739bb4fefb5a92cefd30ec58a172db148 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Thu, 20 Oct 2022 12:43:11 +0200 Subject: Do not render default value for var properties (#2717) --- .../content/signatures/ContentForSignaturesTest.kt | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'plugins/base/src/test/kotlin/content') diff --git a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt index c0f1ebfb..3497317c 100644 --- a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt +++ b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt @@ -373,7 +373,35 @@ class ContentForSignaturesTest : BaseAbstractTest() { pagesTransformationStage = { module -> val page = module.children.single { it.name == "test" } as PackagePageNode page.content.assertNode { - propertySignature(emptyMap(), "protected", "", setOf("lateinit"), "var", "property", "Int", "6") + propertySignature(emptyMap(), "protected", "", setOf("lateinit"), "var", "property", "Int", null) + } + } + } + } + + @Test + fun `should not display default value for mutable property`() { + testInline( + """ + |/src/main/kotlin/test/source.kt + |package test + | + |var property: Int = 6 + """.trimIndent(), testConfiguration + ) { + pagesTransformationStage = { module -> + val page = module.children.single { it.name == "test" } as PackagePageNode + page.content.assertNode { + propertySignature( + annotations = emptyMap(), + visibility = "", + modifier = "", + keywords = setOf(), + preposition = "var", + name = "property", + type = "Int", + value = null + ) } } } -- cgit