aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/utils/contentUtils.kt
diff options
context:
space:
mode:
authorvmishenev <vad-mishenev@yandex.ru>2021-07-28 08:49:52 +0300
committervmishenev <vad-mishenev@yandex.ru>2021-07-30 01:32:42 +0300
commit85cec2dd7ae435d84bad0721c6fd79e9c644c275 (patch)
tree1228d08e124b215fdaa00f08242f5c4ba7a83912 /plugins/base/src/test/kotlin/utils/contentUtils.kt
parentf068030082cd38ec93988c911f4b5511ed64fca3 (diff)
downloaddokka-85cec2dd7ae435d84bad0721c6fd79e9c644c275.tar.gz
dokka-85cec2dd7ae435d84bad0721c6fd79e9c644c275.tar.bz2
dokka-85cec2dd7ae435d84bad0721c6fd79e9c644c275.zip
Improve annotations rendering (#2045)
omit parentheses if there are no parameters add quotes for string literals into annotations
Diffstat (limited to 'plugins/base/src/test/kotlin/utils/contentUtils.kt')
-rw-r--r--plugins/base/src/test/kotlin/utils/contentUtils.kt14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/base/src/test/kotlin/utils/contentUtils.kt b/plugins/base/src/test/kotlin/utils/contentUtils.kt
index 5d8673d0..be796c89 100644
--- a/plugins/base/src/test/kotlin/utils/contentUtils.kt
+++ b/plugins/base/src/test/kotlin/utils/contentUtils.kt
@@ -242,14 +242,16 @@ fun ContentMatcherBuilder<*>.unwrapAnnotation(elem: Map.Entry<String, Set<String
group {
+"@"
link { +elem.key }
- +"("
- elem.value.forEach {
- group {
- +("$it = ")
- skipAllNotMatching()
+ if(elem.value.isNotEmpty()) {
+ +"("
+ elem.value.forEach {
+ group {
+ +("$it = ")
+ skipAllNotMatching()
+ }
}
+ +")"
}
- +")"
}
}