diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-12 17:38:16 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-12 17:38:16 +0400 |
commit | a77f01b4308945e44d05e7e05dc242512e5132eb (patch) | |
tree | fdb131cfb0005844df95b0765285e5cbdc1ca614 /test | |
parent | 1da7b0d28cc101c58e58b4ba00a7ed5890df34f5 (diff) | |
download | dokka-a77f01b4308945e44d05e7e05dc242512e5132eb.tar.gz dokka-a77f01b4308945e44d05e7e05dc242512e5132eb.tar.bz2 dokka-a77f01b4308945e44d05e7e05dc242512e5132eb.zip |
Process Modality (final, open, abstract) and Visibility (public, protected, internal, private)
Diffstat (limited to 'test')
-rw-r--r-- | test/data/functions/genericFunction.kt | 2 | ||||
-rw-r--r-- | test/data/functions/genericFunctionWithConstraints.kt | 2 | ||||
-rw-r--r-- | test/playground.kt | 8 | ||||
-rw-r--r-- | test/src/model/ClassTest.kt | 27 | ||||
-rw-r--r-- | test/src/model/FunctionTest.kt | 28 | ||||
-rw-r--r-- | test/src/model/PropertyTest.kt | 32 |
6 files changed, 65 insertions, 34 deletions
diff --git a/test/data/functions/genericFunction.kt b/test/data/functions/genericFunction.kt index 6e07d04b..05a65070 100644 --- a/test/data/functions/genericFunction.kt +++ b/test/data/functions/genericFunction.kt @@ -2,4 +2,4 @@ /** * generic function */ -fun <T> generic() {}
\ No newline at end of file +private fun <T> generic() {}
\ No newline at end of file diff --git a/test/data/functions/genericFunctionWithConstraints.kt b/test/data/functions/genericFunctionWithConstraints.kt index dc7fa3bb..5f22f8c5 100644 --- a/test/data/functions/genericFunctionWithConstraints.kt +++ b/test/data/functions/genericFunctionWithConstraints.kt @@ -2,5 +2,5 @@ /** * generic function */ -fun <T : R, R> generic() { +public fun <T : R, R> generic() { }
\ No newline at end of file diff --git a/test/playground.kt b/test/playground.kt index ca503791..b401ac63 100644 --- a/test/playground.kt +++ b/test/playground.kt @@ -50,6 +50,9 @@ object Object { /** one line getter doc */ get() = "Member" + val String.valueWithReceiver: Int + get() = 1 + } class OuterClass { @@ -60,6 +63,9 @@ class OuterClass { class NestedClass<T> { fun nestedClassFunction(item: T) { } + + fun String.functionWithReceiver(): Int = 1 + } inner class InnerClass { @@ -67,7 +73,7 @@ class OuterClass { /** doc for R1 type param */ R1, /** doc for R2 type param */ - R2, + R2 >() { } } diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt index 47eeb2ce..05e156f3 100644 --- a/test/src/model/ClassTest.kt +++ b/test/src/model/ClassTest.kt @@ -11,7 +11,7 @@ public class ClassTest { assertEquals(DocumentationNode.Kind.Class, kind) assertEquals("Klass", name) assertEquals(DocumentationContent.Empty, doc) - assertTrue(details.none()) + assertEquals(2, details.count()) assertEquals("<init>", members.single().name) assertTrue(links.none()) } @@ -24,7 +24,7 @@ public class ClassTest { assertEquals(DocumentationNode.Kind.Class, kind) assertEquals("Klass", name) assertEquals(DocumentationContent.Empty, doc) - assertTrue(details.none()) + assertEquals(2, details.count()) assertEquals("<init>", members.single().name) assertTrue(links.none()) } @@ -37,7 +37,7 @@ public class ClassTest { assertEquals(DocumentationNode.Kind.Object, kind) assertEquals("Obj", name) assertEquals(DocumentationContent.Empty, doc) - assertTrue(details.none()) + assertEquals(2, details.count()) assertTrue(members.none()) assertTrue(links.none()) } @@ -50,7 +50,7 @@ public class ClassTest { assertEquals(DocumentationNode.Kind.Class, kind) assertEquals("Klass", name) assertEquals(DocumentationContent.Empty, doc) - assertTrue(details.none()) + assertEquals(2, details.count()) assertTrue(links.none()) assertEquals(1, members.count()) @@ -58,8 +58,9 @@ public class ClassTest { assertEquals("<init>", name) assertEquals(DocumentationContent.Empty, doc) assertEquals(DocumentationNode.Kind.Constructor, kind) - assertEquals(1, details.count()) - with(details.elementAt(0)) { + assertEquals(2, details.count()) + assertEquals("public", details.elementAt(0).name) + with(details.elementAt(1)) { assertEquals("name", name) assertEquals(DocumentationNode.Kind.Parameter, kind) assertEquals(DocumentationContent.Empty, doc) @@ -80,7 +81,7 @@ public class ClassTest { assertEquals(DocumentationNode.Kind.Class, kind) assertEquals("Klass", name) assertEquals(DocumentationContent.Empty, doc) - assertTrue(details.none()) + assertEquals(2, details.count()) assertTrue(links.none()) assertEquals(2, members.count()) @@ -88,7 +89,8 @@ public class ClassTest { assertEquals("<init>", name) assertEquals(DocumentationContent.Empty, doc) assertEquals(DocumentationNode.Kind.Constructor, kind) - assertTrue(details.none()) + assertEquals(1, details.count()) + assertEquals("public", details.elementAt(0).name) assertTrue(links.none()) assertTrue(members.none()) } @@ -96,7 +98,7 @@ public class ClassTest { assertEquals("fn", name) assertEquals(DocumentationContent.Empty, doc) assertEquals(DocumentationNode.Kind.Function, kind) - assertEquals("Unit", details.single().name) + assertEquals("Unit", detail(DocumentationNode.Kind.Type).name) assertTrue(links.none()) assertTrue(members.none()) } @@ -110,7 +112,7 @@ public class ClassTest { assertEquals(DocumentationNode.Kind.Class, kind) assertEquals("Klass", name) assertEquals(DocumentationContent.Empty, doc) - assertTrue(details.none()) + assertEquals(2, details.count()) assertTrue(links.none()) assertEquals(2, members.count()) @@ -118,7 +120,8 @@ public class ClassTest { assertEquals("<init>", name) assertEquals(DocumentationContent.Empty, doc) assertEquals(DocumentationNode.Kind.Constructor, kind) - assertTrue(details.none()) + assertEquals(1, details.count()) + assertEquals("public", details.elementAt(0).name) assertTrue(members.none()) assertTrue(links.none()) } @@ -126,7 +129,7 @@ public class ClassTest { assertEquals("name", name) assertEquals(DocumentationContent.Empty, doc) assertEquals(DocumentationNode.Kind.Property, kind) - assertEquals("String", details.single().name) + assertEquals("String", detail(DocumentationNode.Kind.Type).name) assertTrue(members.none()) assertTrue(links.none()) } diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt index e501d3c0..331c59ba 100644 --- a/test/src/model/FunctionTest.kt +++ b/test/src/model/FunctionTest.kt @@ -11,7 +11,7 @@ public class FunctionTest { assertEquals("fn", name) assertEquals(DocumentationNode.Kind.Function, kind) assertEquals("Function fn", doc.summary) - assertEquals("Unit", details.single().name) + assertEquals("Unit", detail(DocumentationNode.Kind.Type).name) assertTrue(members.none()) assertTrue(links.none()) } @@ -26,8 +26,10 @@ public class FunctionTest { assertEquals("Function with receiver", doc.summary) assertEquals("Unit", details.elementAt(0).name) - assertEquals(2, details.count()) - with(details.elementAt(1)) { + assertEquals(4, details.count()) + assertEquals("final", details.elementAt(1).name) + assertEquals("internal", details.elementAt(2).name) + with(details.elementAt(3)) { assertEquals("<this>", name) assertEquals(DocumentationNode.Kind.Receiver, kind) assertEquals(DocumentationContent.Empty, doc) @@ -48,9 +50,11 @@ public class FunctionTest { assertEquals(DocumentationNode.Kind.Function, kind) assertEquals("generic function", doc.summary) - assertEquals(2, details.count()) + assertEquals(4, details.count()) assertEquals("Unit", details.elementAt(0).name) - with(details.elementAt(1)) { + assertEquals("final", details.elementAt(1).name) + assertEquals("private", details.elementAt(2).name) + with(details.elementAt(3)) { assertEquals("T", name) assertEquals(DocumentationNode.Kind.TypeParameter, kind) assertEquals(DocumentationContent.Empty, doc) @@ -71,9 +75,11 @@ public class FunctionTest { assertEquals(DocumentationNode.Kind.Function, kind) assertEquals("generic function", doc.summary) - assertEquals(3, details.count()) + assertEquals(5, details.count()) assertEquals("Unit", details.elementAt(0).name) - with(details.elementAt(1)) { + assertEquals("final", details.elementAt(1).name) + assertEquals("public", details.elementAt(2).name) + with(details.elementAt(3)) { assertEquals("T", name) assertEquals(DocumentationNode.Kind.TypeParameter, kind) assertEquals(DocumentationContent.Empty, doc) @@ -88,7 +94,7 @@ public class FunctionTest { assertTrue(members.none()) assertTrue(links.none()) } - with(details.elementAt(2)) { + with(details.elementAt(4)) { assertEquals("R", name) assertEquals(DocumentationNode.Kind.TypeParameter, kind) assertEquals(DocumentationContent.Empty, doc) @@ -112,9 +118,11 @@ Function Documentation""" , doc.summary) - assertEquals(2, details.count()) + assertEquals(4, details.count()) assertEquals("Unit", details.elementAt(0).name) - with(details.elementAt(1)) { + assertEquals("final", details.elementAt(1).name) + assertEquals("internal", details.elementAt(2).name) + with(details.elementAt(3)) { assertEquals("x", name) assertEquals(DocumentationNode.Kind.Parameter, kind) assertEquals("parameter", doc.summary) diff --git a/test/src/model/PropertyTest.kt b/test/src/model/PropertyTest.kt index 7768af90..07651ce2 100644 --- a/test/src/model/PropertyTest.kt +++ b/test/src/model/PropertyTest.kt @@ -11,7 +11,7 @@ public class PropertyTest { assertEquals("property", name) assertEquals(DocumentationNode.Kind.Property, kind) assertEquals(DocumentationContent.Empty, doc) - assertEquals("String", details.single().name) + assertEquals("String", detail(DocumentationNode.Kind.Type).name) assertTrue(members.none()) assertTrue(links.none()) } @@ -24,7 +24,7 @@ public class PropertyTest { assertEquals("property", name) assertEquals(DocumentationNode.Kind.Property, kind) assertEquals(DocumentationContent.Empty, doc) - assertEquals("String", details.single().name) + assertEquals("String", detail(DocumentationNode.Kind.Type).name) assertTrue(members.none()) assertTrue(links.none()) } @@ -37,13 +37,13 @@ public class PropertyTest { assertEquals("property", name) assertEquals(DocumentationNode.Kind.Property, kind) assertEquals(DocumentationContent.Empty, doc) - assertEquals("String", details.single().name) + assertEquals("String", detail(DocumentationNode.Kind.Type).name) assertTrue(links.none()) with(members.single()) { assertEquals("<get-property>", name) assertEquals(DocumentationNode.Kind.Function, kind) assertEquals(DocumentationContent.Empty, doc) - assertEquals("String", details.single().name) + assertEquals("String", detail(DocumentationNode.Kind.Type).name) assertTrue(links.none()) assertTrue(members.none()) } @@ -57,7 +57,19 @@ public class PropertyTest { assertEquals("property", name) assertEquals(DocumentationNode.Kind.Property, kind) assertEquals(DocumentationContent.Empty, doc) - assertEquals("String", details.single().name) + assertEquals(3, details.count()) + with(details.elementAt(0)) { + assertEquals(DocumentationNode.Kind.Type, kind) + assertEquals("String", name) + } + with(details.elementAt(1)) { + assertEquals(DocumentationNode.Kind.Modifier, kind) + assertEquals("final", name) + } + with(details.elementAt(2)) { + assertEquals(DocumentationNode.Kind.Modifier, kind) + assertEquals("internal", name) + } assertTrue(links.none()) assertEquals(2, members.count()) @@ -65,7 +77,7 @@ public class PropertyTest { assertEquals("<get-property>", name) assertEquals(DocumentationNode.Kind.Function, kind) assertEquals(DocumentationContent.Empty, doc) - assertEquals("String", details.single().name) + assertEquals("String", detail(DocumentationNode.Kind.Type).name) assertTrue(links.none()) assertTrue(members.none()) } @@ -73,13 +85,15 @@ public class PropertyTest { assertEquals("<set-property>", name) assertEquals(DocumentationNode.Kind.Function, kind) assertEquals(DocumentationContent.Empty, doc) - assertEquals(2, details.count()) + assertEquals(4, details.count()) assertEquals("Unit", details.elementAt(0).name) - with(details.elementAt(1)) { + assertEquals("final", details.elementAt(1).name) + assertEquals("internal", details.elementAt(2).name) + with(details.elementAt(3)) { assertEquals("value", name) assertEquals(DocumentationNode.Kind.Parameter, kind) assertEquals(DocumentationContent.Empty, doc) - assertEquals("String", details.single().name) + assertEquals("String", detail(DocumentationNode.Kind.Type).name) assertTrue(links.none()) assertTrue(members.none()) } |