aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-10 18:55:12 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-10 18:55:12 +0100
commite1a3884fdce26bb28b7580627ffad0d69b8bed61 (patch)
treed32962bbd572f2fec2e9f513881248a52e43f4c7 /test
parent0d0fc1f2bf8f09106e53626bc024298dc91361b8 (diff)
downloaddokka-e1a3884fdce26bb28b7580627ffad0d69b8bed61.tar.gz
dokka-e1a3884fdce26bb28b7580627ffad0d69b8bed61.tar.bz2
dokka-e1a3884fdce26bb28b7580627ffad0d69b8bed61.zip
more sane handling of overloads: don't duplicate signatures, show all documentation of a group of overloads with exactly the same documentation together
Diffstat (limited to 'test')
-rw-r--r--test/data/format/overloadsWithDescription.html19
-rw-r--r--test/data/format/overloadsWithDescription.kt15
-rw-r--r--test/data/format/overloadsWithDifferentDescriptions.html28
-rw-r--r--test/data/format/overloadsWithDifferentDescriptions.kt15
-rw-r--r--test/data/format/paramTag.md2
-rw-r--r--test/data/format/see.html2
-rw-r--r--test/data/format/throwsTag.md2
-rw-r--r--test/src/format/HtmlFormatTest.kt12
8 files changed, 89 insertions, 6 deletions
diff --git a/test/data/format/overloadsWithDescription.html b/test/data/format/overloadsWithDescription.html
new file mode 100644
index 00000000..6b593fcd
--- /dev/null
+++ b/test/data/format/overloadsWithDescription.html
@@ -0,0 +1,19 @@
+<HTML>
+<HEAD>
+<title>test / f</title>
+</HEAD>
+<BODY>
+<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><span class="identifier">f</span><span class="symbol">(</span><span class="identifier">x</span><span class="symbol">: </span><span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></pre><pre><code><span class="keyword">fun </span><span class="identifier">f</span><span class="symbol">(</span><span class="identifier">x</span><span class="symbol">: </span><span class="identifier">String</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></pre><p>Performs an action on x.</p>
+<br/>
+<br/>
+<h3>Description</h3>
+<p>This is a long description.</p>
+<br/>
+<br/>
+<h3>Parameters</h3>
+<code>x</code> - the value to perform the action on.<br/>
+</BODY>
+</HTML>
diff --git a/test/data/format/overloadsWithDescription.kt b/test/data/format/overloadsWithDescription.kt
new file mode 100644
index 00000000..13c219a2
--- /dev/null
+++ b/test/data/format/overloadsWithDescription.kt
@@ -0,0 +1,15 @@
+/**
+ * Performs an action on x.
+ *
+ * This is a long description.
+ * @param x the value to perform the action on.
+ */
+fun f(x: Int) { }
+
+/**
+ * Performs an action on x.
+ *
+ * This is a long description.
+ * @param x the value to perform the action on.
+ */
+fun f(x: String) { }
diff --git a/test/data/format/overloadsWithDifferentDescriptions.html b/test/data/format/overloadsWithDifferentDescriptions.html
new file mode 100644
index 00000000..3ce974af
--- /dev/null
+++ b/test/data/format/overloadsWithDifferentDescriptions.html
@@ -0,0 +1,28 @@
+<HTML>
+<HEAD>
+<title>test / f</title>
+</HEAD>
+<BODY>
+<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><span class="identifier">f</span><span class="symbol">(</span><span class="identifier">x</span><span class="symbol">: </span><span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></pre><p>Performs an action on x.</p>
+<br/>
+<br/>
+<h3>Description</h3>
+<p>This is a long description.</p>
+<br/>
+<br/>
+<h3>Parameters</h3>
+<code>x</code> - the int value to perform the action on.<br/>
+<pre><code><span class="keyword">fun </span><span class="identifier">f</span><span class="symbol">(</span><span class="identifier">x</span><span class="symbol">: </span><span class="identifier">String</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></pre><p>Performs an action on x.</p>
+<br/>
+<br/>
+<h3>Description</h3>
+<p>This is a long description.</p>
+<br/>
+<br/>
+<h3>Parameters</h3>
+<code>x</code> - the string value to perform the action on.<br/>
+</BODY>
+</HTML>
diff --git a/test/data/format/overloadsWithDifferentDescriptions.kt b/test/data/format/overloadsWithDifferentDescriptions.kt
new file mode 100644
index 00000000..ad3169b0
--- /dev/null
+++ b/test/data/format/overloadsWithDifferentDescriptions.kt
@@ -0,0 +1,15 @@
+/**
+ * Performs an action on x.
+ *
+ * This is a long description.
+ * @param x the int value to perform the action on.
+ */
+fun f(x: Int) { }
+
+/**
+ * Performs an action on x.
+ *
+ * This is a long description.
+ * @param x the string value to perform the action on.
+ */
+fun f(x: String) { }
diff --git a/test/data/format/paramTag.md b/test/data/format/paramTag.md
index 9534deb3..02927668 100644
--- a/test/data/format/paramTag.md
+++ b/test/data/format/paramTag.md
@@ -11,8 +11,6 @@ fun f(x: String, y: Int): Unit
-
-
### Parameters
`x` - A string
diff --git a/test/data/format/see.html b/test/data/format/see.html
index fa283363..30409eb7 100644
--- a/test/data/format/see.html
+++ b/test/data/format/see.html
@@ -7,8 +7,6 @@
<h1>quux</h1>
<pre><code><span class="keyword">fun </span><span class="identifier">quux</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></pre><br/>
<br/>
-<br/>
-<br/>
<strong>See Also</strong><br/>
<p><a href="out.html">foo</a></p>
<p><a href="out.html">bar</a></p>
diff --git a/test/data/format/throwsTag.md b/test/data/format/throwsTag.md
index d968483b..e6d0c76e 100644
--- a/test/data/format/throwsTag.md
+++ b/test/data/format/throwsTag.md
@@ -11,8 +11,6 @@ fun f(): Unit
-
-
### Exceptions
`IllegalArgumentException` - on Mondays
diff --git a/test/src/format/HtmlFormatTest.kt b/test/src/format/HtmlFormatTest.kt
index 7dfa80be..53c1a39d 100644
--- a/test/src/format/HtmlFormatTest.kt
+++ b/test/src/format/HtmlFormatTest.kt
@@ -25,6 +25,18 @@ public class HtmlFormatTest {
}
}
+ Test fun overloadsWithDescription() {
+ verifyOutput("test/data/format/overloadsWithDescription.kt", ".html") { model, output ->
+ htmlService.appendNodes(tempLocation, output, model.members.single().members)
+ }
+ }
+
+ Test fun overloadsWithDifferentDescriptions() {
+ verifyOutput("test/data/format/overloadsWithDifferentDescriptions.kt", ".html") { model, output ->
+ htmlService.appendNodes(tempLocation, output, model.members.single().members)
+ }
+ }
+
Test fun deprecated() {
verifyOutput("test/data/format/deprecated.kt", ".package.html") { model, output ->
htmlService.appendNodes(tempLocation, output, model.members)