aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/data/format/deprecated.class.html46
-rw-r--r--test/data/format/deprecated.kt5
-rw-r--r--test/data/format/deprecated.package.html44
-rw-r--r--test/src/format/HtmlFormatTest.kt9
-rw-r--r--test/src/model/ClassTest.kt3
5 files changed, 105 insertions, 2 deletions
diff --git a/test/data/format/deprecated.class.html b/test/data/format/deprecated.class.html
new file mode 100644
index 00000000..87599082
--- /dev/null
+++ b/test/data/format/deprecated.class.html
@@ -0,0 +1,46 @@
+<HTML>
+<HEAD>
+</HEAD>
+<BODY>
+<a href="out.html">test</a>&nbsp;/&nbsp;<a href="out.html"></a>&nbsp;/&nbsp;<a href="out.html">C</a><br/>
+<br/>
+<h1>C</h1>
+<pre><code><span class="keyword">class </span><s><span class="identifier">C</span></s></code></pre><strong>Deprecated: </strong>This class sucks<br/>
+<br/>
+<br/>
+<a href="out.html">test</a>&nbsp;/&nbsp;<a href="out.html"></a>&nbsp;/&nbsp;<a href="out.html">f</a><br/>
+<br/>
+<h1>f</h1>
+<pre><code><span class="keyword">fun </span><s><span class="identifier">f</span></s><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></pre><strong>Deprecated: </strong>This function sucks<br/>
+<br/>
+<br/>
+<a href="out.html">test</a>&nbsp;/&nbsp;<a href="out.html"></a>&nbsp;/&nbsp;<a href="out.html">p</a><br/>
+<br/>
+<h1>p</h1>
+<pre><code><span class="keyword">val </span><s><span class="identifier">p</span></s><span class="symbol">: </span><span class="identifier">Int</span></code></pre><strong>Deprecated: </strong>This property sucks<br/>
+<br/>
+<br/>
+<h3>Constructors</h3>
+<table>
+<tbody>
+<tr>
+<td>
+<a href="out.html">&lt;init&gt;</a></td>
+<td>
+<code><span class="keyword">public</span> <span class="identifier">C</span><span class="symbol">(</span><span class="symbol">)</span></code></td>
+</tr>
+</tbody>
+</table>
+<h3>Accessors</h3>
+<table>
+<tbody>
+<tr>
+<td>
+<a href="out.html">get</a></td>
+<td>
+<code></code></td>
+</tr>
+</tbody>
+</table>
+</BODY>
+</HTML>
diff --git a/test/data/format/deprecated.kt b/test/data/format/deprecated.kt
new file mode 100644
index 00000000..9ee2c1d6
--- /dev/null
+++ b/test/data/format/deprecated.kt
@@ -0,0 +1,5 @@
+deprecated("This class sucks") class C() { }
+
+deprecated("This function sucks") fun f() { }
+
+deprecated("This property sucks") val p: Int get() = 0
diff --git a/test/data/format/deprecated.package.html b/test/data/format/deprecated.package.html
new file mode 100644
index 00000000..cf563a8b
--- /dev/null
+++ b/test/data/format/deprecated.package.html
@@ -0,0 +1,44 @@
+<HTML>
+<HEAD>
+</HEAD>
+<BODY>
+<a href="out.html">test</a>&nbsp;/&nbsp;<a href="out.html"></a><br/>
+<br/>
+<h1></h1>
+<pre><code><span class="keyword">package</span> <span class="identifier"></span></code></pre><br/>
+<br/>
+<h3>Types</h3>
+<table>
+<tbody>
+<tr>
+<td>
+<a href="out.html">C</a></td>
+<td>
+<code><span class="keyword">class </span><s><span class="identifier">C</span></s></code></td>
+</tr>
+</tbody>
+</table>
+<h3>Properties</h3>
+<table>
+<tbody>
+<tr>
+<td>
+<a href="out.html">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>
+</tbody>
+</table>
+<h3>Functions</h3>
+<table>
+<tbody>
+<tr>
+<td>
+<a href="out.html">f</a></td>
+<td>
+<code><span class="keyword">fun </span><s><span class="identifier">f</span></s><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></td>
+</tr>
+</tbody>
+</table>
+</BODY>
+</HTML>
diff --git a/test/src/format/HtmlFormatTest.kt b/test/src/format/HtmlFormatTest.kt
index 881a7828..47fe9c4e 100644
--- a/test/src/format/HtmlFormatTest.kt
+++ b/test/src/format/HtmlFormatTest.kt
@@ -24,4 +24,13 @@ public class HtmlFormatTest {
htmlService.appendNodes(tempLocation, output, model.members)
}
}
+
+ Test fun deprecated() {
+ verifyOutput("test/data/format/deprecated.kt", ".package.html") { model, output ->
+ htmlService.appendNodes(tempLocation, output, model.members)
+ }
+ verifyOutput("test/data/format/deprecated.kt", ".class.html") { model, output ->
+ htmlService.appendNodes(tempLocation, output, model.members.single().members)
+ }
+ }
}
diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt
index ae82a4f1..f21c5c57 100644
--- a/test/src/model/ClassTest.kt
+++ b/test/src/model/ClassTest.kt
@@ -183,8 +183,7 @@ 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]) {
+ with(deprecation!!) {
assertEquals("deprecated", name)
assertEquals(Content.Empty, content)
assertEquals(DocumentationNode.Kind.Annotation, kind)