aboutsummaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/format/MarkdownFormatTest.kt6
-rw-r--r--test/src/model/ClassTest.kt14
-rw-r--r--test/src/model/FunctionTest.kt30
-rw-r--r--test/src/model/PropertyTest.kt13
4 files changed, 62 insertions, 1 deletions
diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt
index 5cdfb8b5..e9852964 100644
--- a/test/src/format/MarkdownFormatTest.kt
+++ b/test/src/format/MarkdownFormatTest.kt
@@ -19,4 +19,10 @@ public class MarkdownFormatTest {
markdownService.appendNodes(tempLocation, output, model.members.single().members)
}
}
+
+ Test fun annotations() {
+ verifyOutput("test/data/format/annotations.kt") { model, output ->
+ markdownService.appendNodes(tempLocation, output, model.members.single().members)
+ }
+ }
}
diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt
index b95a31dc..b9be30bf 100644
--- a/test/src/model/ClassTest.kt
+++ b/test/src/model/ClassTest.kt
@@ -167,3 +167,17 @@ public class ClassTest {
}
}
}
+
+ Test fun annotatedClass() {
+ verifyModel("test/data/classes/annotatedClass.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(1, annotations.count())
+ with(annotations[0]) {
+ assertEquals("data", name)
+ assertEquals(Content.Empty, content)
+ assertEquals(DocumentationNode.Kind.Annotation, kind)
+ }
+ }
+ }
+ }
+}
diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt
index 2a4ad0a5..d3d7843a 100644
--- a/test/src/model/FunctionTest.kt
+++ b/test/src/model/FunctionTest.kt
@@ -135,4 +135,32 @@ Documentation""", content.description.toTestString())
}
}
}
-} \ No newline at end of file
+
+ Test fun annotatedFunction() {
+ verifyModel("test/data/functions/annotatedFunction.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(1, annotations.count())
+ with(annotations[0]) {
+ assertEquals("inline", name)
+ assertEquals(Content.Empty, content)
+ assertEquals(DocumentationNode.Kind.Annotation, kind)
+ }
+ }
+ }
+ }
+
+ Test fun functionWithAnnotatedParam() {
+ verifyModel("test/data/functions/functionWithAnnotatedParam.kt") { model ->
+ with(model.members.single().members.single()) {
+ with(details.elementAt(2)) {
+ assertEquals(1, annotations.count())
+ with(annotations[0]) {
+ assertEquals("noinline", name)
+ assertEquals(Content.Empty, content)
+ assertEquals(DocumentationNode.Kind.Annotation, kind)
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/test/src/model/PropertyTest.kt b/test/src/model/PropertyTest.kt
index 103da170..0bf9714d 100644
--- a/test/src/model/PropertyTest.kt
+++ b/test/src/model/PropertyTest.kt
@@ -99,4 +99,17 @@ public class PropertyTest {
}
}
}
+
+ Test fun annotatedProperty() {
+ verifyModel("test/data/properties/annotatedProperty.kt") { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(1, annotations.count())
+ with(annotations[0]) {
+ assertEquals("inline", name)
+ assertEquals(Content.Empty, content)
+ assertEquals(DocumentationNode.Kind.Annotation, kind)
+ }
+ }
+ }
+ }
}