From e1a3884fdce26bb28b7580627ffad0d69b8bed61 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 10 Feb 2015 18:55:12 +0100 Subject: more sane handling of overloads: don't duplicate signatures, show all documentation of a group of overloads with exactly the same documentation together --- test/data/format/overloadsWithDescription.html | 19 +++++++++++++++ test/data/format/overloadsWithDescription.kt | 15 ++++++++++++ .../format/overloadsWithDifferentDescriptions.html | 28 ++++++++++++++++++++++ .../format/overloadsWithDifferentDescriptions.kt | 15 ++++++++++++ test/data/format/paramTag.md | 2 -- test/data/format/see.html | 2 -- test/data/format/throwsTag.md | 2 -- test/src/format/HtmlFormatTest.kt | 12 ++++++++++ 8 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 test/data/format/overloadsWithDescription.html create mode 100644 test/data/format/overloadsWithDescription.kt create mode 100644 test/data/format/overloadsWithDifferentDescriptions.html create mode 100644 test/data/format/overloadsWithDifferentDescriptions.kt (limited to 'test') 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 @@ + + +test / f + + +test /  / f
+
+

f

+
fun f(x: Int): Unit
fun f(x: String): Unit

Performs an action on x.

+
+
+

Description

+

This is a long description.

+
+
+

Parameters

+x - the value to perform the action on.
+ + 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 @@ + + +test / f + + +test /  / f
+
+

f

+
fun f(x: Int): Unit

Performs an action on x.

+
+
+

Description

+

This is a long description.

+
+
+

Parameters

+x - the int value to perform the action on.
+
fun f(x: String): Unit

Performs an action on x.

+
+
+

Description

+

This is a long description.

+
+
+

Parameters

+x - the string value to perform the action on.
+ + 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 @@

quux

fun quux(): Unit


-
-
See Also

foo

bar

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) -- cgit