aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/data/format/accessor.get.md8
-rw-r--r--test/data/format/accessor.kt4
-rw-r--r--test/data/format/accessor.md18
-rw-r--r--test/data/format/accessor.set.md8
-rw-r--r--test/data/format/deprecated.class.html13
-rw-r--r--test/data/format/deprecated.package.html2
-rw-r--r--test/data/format/extensions.class.md2
-rw-r--r--test/src/format/MarkdownFormatTest.kt10
-rw-r--r--test/src/model/PropertyTest.kt43
9 files changed, 28 insertions, 80 deletions
diff --git a/test/data/format/accessor.get.md b/test/data/format/accessor.get.md
deleted file mode 100644
index 67a2f395..00000000
--- a/test/data/format/accessor.get.md
+++ /dev/null
@@ -1,8 +0,0 @@
-[test](test/index) / [C](test/-c/index) / [x](test/-c/x/index) / [get](test/-c/x/get)
-
-
-# get
-
-`get(): String`
-
-
diff --git a/test/data/format/accessor.kt b/test/data/format/accessor.kt
index b6ed9624..5a4d1742 100644
--- a/test/data/format/accessor.kt
+++ b/test/data/format/accessor.kt
@@ -1,5 +1,5 @@
class C() {
var x: String
- get() = ""
- set(value) { }
+ /** The getter returns an empty string. */ get() = ""
+ /** The setter does nothing. */ set(value) { }
}
diff --git a/test/data/format/accessor.md b/test/data/format/accessor.md
new file mode 100644
index 00000000..8279f452
--- /dev/null
+++ b/test/data/format/accessor.md
@@ -0,0 +1,18 @@
+[test](test/index) / [C](test/-c/index) / [x](test/-c/x)
+
+
+# x
+
+`var x: String`
+**Getter**
+
+The getter returns an empty string.
+
+
+**Setter**
+
+The setter does nothing.
+
+
+
+
diff --git a/test/data/format/accessor.set.md b/test/data/format/accessor.set.md
deleted file mode 100644
index e93766cd..00000000
--- a/test/data/format/accessor.set.md
+++ /dev/null
@@ -1,8 +0,0 @@
-[test](test/index) / [C](test/-c/index) / [x](test/-c/x/index) / [set](test/-c/x/set)
-
-
-# set
-
-`set(value: String)`
-
-
diff --git a/test/data/format/deprecated.class.html b/test/data/format/deprecated.class.html
index 352bd435..922306fc 100644
--- a/test/data/format/deprecated.class.html
+++ b/test/data/format/deprecated.class.html
@@ -16,7 +16,7 @@
<strong>Deprecated:</strong> This function sucks<br/>
<br/>
<br/>
-<a href="test/index">test</a>&nbsp;/&nbsp;<a href="test/p/index">p</a><br/>
+<a href="test/index">test</a>&nbsp;/&nbsp;<a href="test/p">p</a><br/>
<br/>
<h1>p</h1>
<code><span class="keyword">val </span><s><span class="identifier">p</span></s><span class="symbol">: </span><span class="identifier">Int</span></code><br/>
@@ -34,16 +34,5 @@
</tr>
</tbody>
</table>
-<h3>Accessors</h3>
-<table>
-<tbody>
-<tr>
-<td>
-<a href="test/p/get">get</a></td>
-<td>
-<code><span class="identifier">get</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Int</span></code></td>
-</tr>
-</tbody>
-</table>
</BODY>
</HTML>
diff --git a/test/data/format/deprecated.package.html b/test/data/format/deprecated.package.html
index 8e3c2aa9..1700eb15 100644
--- a/test/data/format/deprecated.package.html
+++ b/test/data/format/deprecated.package.html
@@ -25,7 +25,7 @@
<tbody>
<tr>
<td>
-<a href="test/p/index">p</a></td>
+<a href="test/p">p</a></td>
<td>
<code><span class="keyword">val </span><s><span class="identifier">p</span></s><span class="symbol">: </span><span class="identifier">Int</span></code></td>
</tr>
diff --git a/test/data/format/extensions.class.md b/test/data/format/extensions.class.md
index 11ee9ba7..33721e67 100644
--- a/test/data/format/extensions.class.md
+++ b/test/data/format/extensions.class.md
@@ -9,7 +9,7 @@
Function with receiver
|
-| [foobar](test/foo/-string/foobar/index) | `val String.foobar: Int`
+| [foobar](test/foo/-string/foobar) | `val String.foobar: Int`
Property with receiver.
|
diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt
index 7e379cf9..4b207b75 100644
--- a/test/src/format/MarkdownFormatTest.kt
+++ b/test/src/format/MarkdownFormatTest.kt
@@ -83,13 +83,9 @@ public class MarkdownFormatTest {
}
Test fun accessor() {
- verifyOutput("test/data/format/accessor.kt", ".get.md") { model, output ->
- val propertyNode = model.members.single().members.first { it.name == "C" }.members.first { it.name == "x" }
- markdownService.appendNodes(tempLocation, output, listOf(propertyNode.members[0]))
- }
- verifyOutput("test/data/format/accessor.kt", ".set.md") { model, output ->
- val propertyNode = model.members.single().members.first { it.name == "C" }.members.first { it.name == "x" }
- markdownService.appendNodes(tempLocation, output, listOf(propertyNode.members[1]))
+ verifyOutput("test/data/format/accessor.kt", ".md") { model, output ->
+ val propertyNode = model.members.single().members.first { it.name == "C" }.members.filter { it.name == "x" }
+ markdownService.appendNodes(tempLocation, output, propertyNode)
}
}
diff --git a/test/src/model/PropertyTest.kt b/test/src/model/PropertyTest.kt
index 1a9ef995..93a0f681 100644
--- a/test/src/model/PropertyTest.kt
+++ b/test/src/model/PropertyTest.kt
@@ -39,14 +39,7 @@ public class PropertyTest {
assertEquals(Content.Empty, content)
assertEquals("String", detail(DocumentationNode.Kind.Type).name)
assertTrue(links.none())
- with(members.single()) {
- assertEquals("get", name)
- assertEquals(DocumentationNode.Kind.PropertyAccessor, kind)
- assertEquals(Content.Empty, content)
- assertEquals("String", detail(DocumentationNode.Kind.Type).name)
- assertTrue(links.none())
- assertTrue(members.none())
- }
+ assertTrue(members.none())
}
}
}
@@ -64,39 +57,7 @@ public class PropertyTest {
assertTrue("internal" in modifiers)
assertTrue("var" in modifiers)
assertTrue(links.none())
-
- assertEquals(2, members.count())
- with(members.elementAt(0)) {
- assertEquals("get", name)
- assertEquals(DocumentationNode.Kind.PropertyAccessor, kind)
- assertEquals(Content.Empty, content)
- val get_modifiers = details(DocumentationNode.Kind.Modifier).map { it.name }
- assertTrue("final" in get_modifiers)
- assertTrue("internal" in get_modifiers)
- assertEquals("String", detail(DocumentationNode.Kind.Type).name)
- assertTrue(links.none())
- assertTrue(members.none())
- }
- with(members.elementAt(1)) {
- assertEquals("set", name)
- assertEquals(DocumentationNode.Kind.PropertyAccessor, kind)
- assertEquals(Content.Empty, content)
- assertEquals(4, details.count())
- assertEquals("Unit", detail(DocumentationNode.Kind.Type).name)
- val set_modifiers = details(DocumentationNode.Kind.Modifier).map { it.name }
- assertTrue("final" in set_modifiers)
- assertTrue("internal" in set_modifiers)
- with(detail(DocumentationNode.Kind.Parameter)) {
- assertEquals("value", name)
- assertEquals(DocumentationNode.Kind.Parameter, kind)
- assertEquals(Content.Empty, content)
- assertEquals("String", detail(DocumentationNode.Kind.Type).name)
- assertTrue(links.none())
- assertTrue(members.none())
- }
- assertTrue(links.none())
- assertTrue(members.none())
- }
+ assertTrue(members.none())
}
}
}