aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/data/classes/defaultObjectExtension.kt10
-rw-r--r--test/data/format/defaultObjectExtension.kt10
-rw-r--r--test/data/format/defaultObjectExtension.md23
-rw-r--r--test/src/format/MarkdownFormatTest.kt8
-rw-r--r--test/src/model/ClassTest.kt9
5 files changed, 59 insertions, 1 deletions
diff --git a/test/data/classes/defaultObjectExtension.kt b/test/data/classes/defaultObjectExtension.kt
new file mode 100644
index 00000000..0bef8a49
--- /dev/null
+++ b/test/data/classes/defaultObjectExtension.kt
@@ -0,0 +1,10 @@
+class Foo {
+ class object Default {
+ }
+}
+
+
+/**
+ * The def
+ */
+val Foo.Default.x: Int get() = 1
diff --git a/test/data/format/defaultObjectExtension.kt b/test/data/format/defaultObjectExtension.kt
new file mode 100644
index 00000000..e367aa41
--- /dev/null
+++ b/test/data/format/defaultObjectExtension.kt
@@ -0,0 +1,10 @@
+class Foo {
+ class object Default {
+ }
+}
+
+
+/**
+ * The default object property.
+ */
+val Foo.Default.x: Int get() = 1
diff --git a/test/data/format/defaultObjectExtension.md b/test/data/format/defaultObjectExtension.md
new file mode 100644
index 00000000..4ede33e8
--- /dev/null
+++ b/test/data/format/defaultObjectExtension.md
@@ -0,0 +1,23 @@
+[test](test/index) / [Foo](test/-foo/index)
+
+
+# Foo
+
+`class Foo`
+
+
+
+### Constructors
+
+
+| [<init>](test/-foo/-init-) | `Foo()` |
+
+
+### Default Object Extension Properties
+
+
+| [x](test/x) | `val Foo.Default.x: Int`
+The default object property.
+
+ |
+
diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt
index 33718e87..1c46e662 100644
--- a/test/src/format/MarkdownFormatTest.kt
+++ b/test/src/format/MarkdownFormatTest.kt
@@ -155,9 +155,15 @@ public class MarkdownFormatTest {
}
}
- Test fun javadocOrderedLIst() {
+ Test fun javadocOrderedList() {
verifyOutput("test/data/format/javadocOrderedList.java", ".md") { model, output ->
markdownService.appendNodes(tempLocation, output, model.members.single().members.filter { it.name == "Bar" })
}
}
+
+ Test fun defaultObjectExtension() {
+ verifyOutput("test/data/format/defaultObjectExtension.kt", ".md") { model, output ->
+ markdownService.appendNodes(tempLocation, output, model.members.single().members.filter { it.name == "Foo" })
+ }
+ }
}
diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt
index d16b9491..61af5361 100644
--- a/test/src/model/ClassTest.kt
+++ b/test/src/model/ClassTest.kt
@@ -244,4 +244,13 @@ public class ClassTest {
assertEquals("inner", modifiers[2].name)
}
}
+
+ Test fun defaultObjectExtension() {
+ verifyModel("test/data/classes/defaultObjectExtension.kt") { model ->
+ val pkg = model.members.single()
+ val cls = pkg.members.single { it.name == "Foo" }
+ val extensions = cls.extensions.filter { it.kind == DocumentationNode.Kind.DefaultObjectProperty }
+ assertEquals(1, extensions.size())
+ }
+ }
}