aboutsummaryrefslogtreecommitdiff
path: root/test/src/model
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2014-12-30 18:47:03 +0100
committerDmitry Jemerov <yole@jetbrains.com>2014-12-30 18:47:03 +0100
commit69dd2988ec98a9fa027fcc805f28efbe8758d476 (patch)
tree84badb429672162a55cb09ab082519b40cba3620 /test/src/model
parent716483c2f20e4af1951342f2acc9a231fcbeab3b (diff)
downloaddokka-69dd2988ec98a9fa027fcc805f28efbe8758d476.tar.gz
dokka-69dd2988ec98a9fa027fcc805f28efbe8758d476.tar.bz2
dokka-69dd2988ec98a9fa027fcc805f28efbe8758d476.zip
support and render annotation parameters
Diffstat (limited to 'test/src/model')
-rw-r--r--test/src/model/ClassTest.kt44
-rw-r--r--test/src/model/FunctionTest.kt23
2 files changed, 67 insertions, 0 deletions
diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt
index 257d73eb..ae82a4f1 100644
--- a/test/src/model/ClassTest.kt
+++ b/test/src/model/ClassTest.kt
@@ -179,4 +179,48 @@ public class ClassTest {
}
}
}
+
+ Test fun annotatedClassWithAnnotationParameters() {
+ verifyModel("test/data/classes/annotatedClassWithAnnotationParameters.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(1, annotations.count())
+ with(annotations[0]) {
+ assertEquals("deprecated", name)
+ assertEquals(Content.Empty, content)
+ assertEquals(DocumentationNode.Kind.Annotation, kind)
+ assertEquals(1, details.count())
+ with(details[0]) {
+ assertEquals(DocumentationNode.Kind.Parameter, kind)
+ assertEquals(1, details.count())
+ with(details[0]) {
+ assertEquals(DocumentationNode.Kind.Value, kind)
+ assertEquals("\"should no longer be used\"", name)
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Test fun javaAnnotationClass() {
+ verifyModel("test/data/classes/javaAnnotationClass.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(1, annotations.count())
+ with(annotations[0]) {
+ assertEquals("Retention", name)
+ assertEquals(Content.Empty, content)
+ assertEquals(DocumentationNode.Kind.Annotation, kind)
+ assertEquals(1, details.count())
+ with(details[0]) {
+ assertEquals(DocumentationNode.Kind.Parameter, kind)
+ assertEquals(1, details.count())
+ with(details[0]) {
+ assertEquals(DocumentationNode.Kind.Value, kind)
+ assertEquals("RetentionPolicy.SOURCE", name)
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt
index d3d7843a..bf7471ea 100644
--- a/test/src/model/FunctionTest.kt
+++ b/test/src/model/FunctionTest.kt
@@ -163,4 +163,27 @@ Documentation""", content.description.toTestString())
}
}
}
+
+ Test fun annotatedFunctionWithAnnotationParameters() {
+ verifyModel("test/data/functions/annotatedFunctionWithAnnotationParameters.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(1, annotations.count())
+ with(annotations[0]) {
+ assertEquals("inlineOptions", name)
+ assertEquals(Content.Empty, content)
+ assertEquals(DocumentationNode.Kind.Annotation, kind)
+ assertEquals(1, details.count())
+ with(details[0]) {
+ assertEquals(DocumentationNode.Kind.Parameter, kind)
+ assertEquals(1, details.count())
+ with(details[0]) {
+ assertEquals(DocumentationNode.Kind.Value, kind)
+ assertEquals("[InlineOption.LOCAL_CONTINUE_AND_BREAK]", name)
+ }
+ }
+ }
+ }
+ }
+ }
}
+