From e17eaa5fbc296bab0f32e8169d50fea06a6de581 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 9 Jan 2015 20:59:58 +0100 Subject: nice rendering for deprecated members --- test/data/format/deprecated.class.html | 46 ++++++++++++++++++++++++++++++++ test/data/format/deprecated.kt | 5 ++++ test/data/format/deprecated.package.html | 44 ++++++++++++++++++++++++++++++ test/src/format/HtmlFormatTest.kt | 9 +++++++ test/src/model/ClassTest.kt | 3 +-- 5 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 test/data/format/deprecated.class.html create mode 100644 test/data/format/deprecated.kt create mode 100644 test/data/format/deprecated.package.html (limited to 'test') 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 @@ + + + + +test /  / C
+
+

C

+
class C
Deprecated: This class sucks
+
+
+test /  / f
+
+

f

+
fun f(): Unit
Deprecated: This function sucks
+
+
+test /  / p
+
+

p

+
val p: Int
Deprecated: This property sucks
+
+
+

Constructors

+ + + + + + + +
+<init> +public C()
+

Accessors

+ + + + + + + +
+get +
+ + 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 @@ + + + + +test / 
+
+

+
package 

+
+

Types

+ + + + + + + +
+C +class C
+

Properties

+ + + + + + + +
+p +val p: Int
+

Functions

+ + + + + + + +
+f +fun f(): Unit
+ + 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) -- cgit