From d197f0544b4cd1ade870ebde0d6a6a43a94daf9a Mon Sep 17 00:00:00 2001 From: vmishenev Date: Mon, 9 Aug 2021 12:51:59 +0300 Subject: Property annotation for getter and setter (#2049) --- .../src/test/kotlin/signatures/SignatureTest.kt | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'plugins/base/src/test') diff --git a/plugins/base/src/test/kotlin/signatures/SignatureTest.kt b/plugins/base/src/test/kotlin/signatures/SignatureTest.kt index 35590d52..a56c408b 100644 --- a/plugins/base/src/test/kotlin/signatures/SignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/SignatureTest.kt @@ -279,6 +279,40 @@ class SignatureTest : BaseAbstractTest() { } } + @Test + fun `property with annotation`() { + val source = """ + |/src/main/kotlin/test/Test.kt + |package example + | + | @MustBeDocumented() + | @Target(AnnotationTarget.FUNCTION) + | annotation class Marking + | + | @get:Marking() + | @set:Marking() + | var str: String + """.trimIndent() + val writerPlugin = TestOutputWriterPlugin() + + testInline( + source, + configuration, + pluginOverrides = listOf(writerPlugin) + ) { + renderingStage = { _, _ -> + writerPlugin.writer.renderedContent("root/example/str.html").firstSignature().match( + Div( + Div("@get:", A("Marking")), + Div("@set:", A("Marking")) + ), + "var ", A("str"), + ": ", A("String"), Span() + ) + } + } + } + @Test fun `fun with two annotations`() { val source = """ -- cgit