From d47d386ad8c0ff4a2c3b9d5b4450a773bdcba2dc Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Mon, 4 May 2020 13:53:10 +0200 Subject: Enhance signature presentation. Support presetnation Java as Kotlin and Kotlin as Java. Refactor annotations creation from PSI/Descriptors. Add proper rendering of annotation signatures in both kotlin syntax and java syntax. Tests for annotations --- .../kotlin/content/params/ContentForParamsTest.kt | 95 ++++++++++++++++------ 1 file changed, 69 insertions(+), 26 deletions(-) (limited to 'plugins/base/src/test/kotlin/content/params') diff --git a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt index 15f70eae..31f62918 100644 --- a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt +++ b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt @@ -39,7 +39,13 @@ class ContentForParamsTest : AbstractCoreTest() { divergentGroup { divergentInstance { divergent { - bareSignature("function", null, "abc" to "String") + bareSignature( + emptyMap(), "", "", emptySet(), "function", null, "abc" to ParamAttributes( + emptyMap(), + emptySet(), + "String" + ) + ) } } } @@ -72,7 +78,15 @@ class ContentForParamsTest : AbstractCoreTest() { divergentGroup { divergentInstance { divergent { - bareSignature("function", null, "abc" to "String") + bareSignature( + emptyMap(), + "", + "", + emptySet(), + "function", + null, + "abc" to ParamAttributes(emptyMap(), emptySet(), "String") + ) } after { pWrapped("comment to function") @@ -109,7 +123,15 @@ class ContentForParamsTest : AbstractCoreTest() { divergentGroup { divergentInstance { divergent { - bareSignature("function", null, "abc" to "String") + bareSignature( + emptyMap(), + "", + "", + emptySet(), + "function", + null, + "abc" to ParamAttributes(emptyMap(), emptySet(), "String") + ) } after { unnamedTag("Author") { +"Kordyjan" } @@ -148,7 +170,15 @@ class ContentForParamsTest : AbstractCoreTest() { divergentGroup { divergentInstance { divergent { - bareSignature("function", null, "abc" to "String") + bareSignature( + emptyMap(), + "", + "", + emptySet(), + "function", + null, + "abc" to ParamAttributes(emptyMap(), emptySet(), "String") + ) } after { pWrapped("comment to function") @@ -187,7 +217,15 @@ class ContentForParamsTest : AbstractCoreTest() { divergentGroup { divergentInstance { divergent { - bareSignature("function", null, "abc" to "String") + bareSignature( + emptyMap(), + "", + "", + emptySet(), + "function", + null, + "abc" to ParamAttributes(emptyMap(), emptySet(), "String") + ) } after { pWrapped("comment to function") @@ -238,11 +276,10 @@ class ContentForParamsTest : AbstractCoreTest() { divergentInstance { divergent { bareSignature( - "function", - null, - "first" to "String", - "second" to "Int", - "third" to "Double" + emptyMap(), "", "", emptySet(), "function", null, + "first" to ParamAttributes(emptyMap(), emptySet(), "String"), + "second" to ParamAttributes(emptyMap(), emptySet(), "Int"), + "third" to ParamAttributes(emptyMap(), emptySet(), "Double") ) } after { @@ -301,11 +338,10 @@ class ContentForParamsTest : AbstractCoreTest() { divergentInstance { divergent { bareSignature( - "function", - null, - "first" to "String", - "second" to "Int", - "third" to "Double" + emptyMap(), "", "", emptySet(), "function", null, + "first" to ParamAttributes(emptyMap(), emptySet(), "String"), + "second" to ParamAttributes(emptyMap(), emptySet(), "Int"), + "third" to ParamAttributes(emptyMap(), emptySet(), "Double") ) } after { @@ -362,7 +398,16 @@ class ContentForParamsTest : AbstractCoreTest() { divergentGroup { divergentInstance { divergent { - bareSignatureWithReceiver("String", "function", null, "abc" to "String") + bareSignatureWithReceiver( + emptyMap(), + "", + "", + emptySet(), + "String", + "function", + null, + "abc" to ParamAttributes(emptyMap(), emptySet(), "String") + ) } after { pWrapped("comment to function") @@ -416,11 +461,10 @@ class ContentForParamsTest : AbstractCoreTest() { divergentInstance { divergent { bareSignature( - "function", - null, - "first" to "String", - "second" to "Int", - "third" to "Double" + emptyMap(), "", "", emptySet(), "function", null, + "first" to ParamAttributes(emptyMap(), emptySet(), "String"), + "second" to ParamAttributes(emptyMap(), emptySet(), "Int"), + "third" to ParamAttributes(emptyMap(), emptySet(), "Double") ) } after { @@ -478,11 +522,10 @@ class ContentForParamsTest : AbstractCoreTest() { divergentInstance { divergent { bareSignature( - "function", - null, - "first" to "String", - "second" to "Int", - "third" to "Double" + emptyMap(), "", "", emptySet(), "function", null, + "first" to ParamAttributes(emptyMap(), emptySet(), "String"), + "second" to ParamAttributes(emptyMap(), emptySet(), "Int"), + "third" to ParamAttributes(emptyMap(), emptySet(), "Double") ) } after { -- cgit