diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-05-03 13:45:30 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-05-11 19:52:40 +0300 |
commit | a86c859eba6154524f3b42461aad6b45f26e3650 (patch) | |
tree | 6772882331daf29c8d19e4a3ed77ef938d45b1ac /core/src/test/kotlin/model | |
parent | 022a6a6bc9a1d61f190715dec56c3bef31887388 (diff) | |
download | dokka-a86c859eba6154524f3b42461aad6b45f26e3650.tar.gz dokka-a86c859eba6154524f3b42461aad6b45f26e3650.tar.bz2 dokka-a86c859eba6154524f3b42461aad6b45f26e3650.zip |
Support linking of external documentation
Introduce PackageListService
#KT-16309 fixed
Diffstat (limited to 'core/src/test/kotlin/model')
-rw-r--r-- | core/src/test/kotlin/model/ClassTest.kt | 8 | ||||
-rw-r--r-- | core/src/test/kotlin/model/FunctionTest.kt | 28 |
2 files changed, 18 insertions, 18 deletions
diff --git a/core/src/test/kotlin/model/ClassTest.kt b/core/src/test/kotlin/model/ClassTest.kt index f8baf251..ea586041 100644 --- a/core/src/test/kotlin/model/ClassTest.kt +++ b/core/src/test/kotlin/model/ClassTest.kt @@ -45,9 +45,9 @@ class ClassTest { assertEquals("<init>", name) assertEquals(Content.Empty, content) assertEquals(NodeKind.Constructor, kind) - assertEquals(2, details.count()) + assertEquals(3, details.count()) assertEquals("public", details.elementAt(0).name) - with(details.elementAt(1)) { + with(details.elementAt(2)) { assertEquals("name", name) assertEquals(NodeKind.Parameter, kind) assertEquals(Content.Empty, content) @@ -75,7 +75,7 @@ class ClassTest { assertEquals("<init>", name) assertEquals(Content.Empty, content) assertEquals(NodeKind.Constructor, kind) - assertEquals(1, details.count()) + assertEquals(2, details.count()) assertEquals("public", details.elementAt(0).name) assertTrue(links.none()) assertTrue(members.none()) @@ -105,7 +105,7 @@ class ClassTest { assertEquals("<init>", name) assertEquals(Content.Empty, content) assertEquals(NodeKind.Constructor, kind) - assertEquals(1, details.count()) + assertEquals(2, details.count()) assertEquals("public", details.elementAt(0).name) assertTrue(members.none()) assertTrue(links.none()) diff --git a/core/src/test/kotlin/model/FunctionTest.kt b/core/src/test/kotlin/model/FunctionTest.kt index ddd33941..065decef 100644 --- a/core/src/test/kotlin/model/FunctionTest.kt +++ b/core/src/test/kotlin/model/FunctionTest.kt @@ -32,7 +32,7 @@ class FunctionTest { assertEquals("Function with receiver", content.summary.toTestString()) assertEquals("public", details.elementAt(0).name) assertEquals("final", details.elementAt(1).name) - with(details.elementAt(2)) { + with(details.elementAt(3)) { assertEquals("<this>", name) assertEquals(NodeKind.Receiver, kind) assertEquals(Content.Empty, content) @@ -40,7 +40,7 @@ class FunctionTest { assertTrue(members.none()) assertTrue(links.none()) } - assertEquals("Unit", details.elementAt(3).name) + assertEquals("Unit", details.elementAt(4).name) assertTrue(members.none()) assertTrue(links.none()) } @@ -61,7 +61,7 @@ class FunctionTest { assertEquals("private", details.elementAt(0).name) assertEquals("final", details.elementAt(1).name) - with(details.elementAt(2)) { + with(details.elementAt(3)) { assertEquals("T", name) assertEquals(NodeKind.TypeParameter, kind) assertEquals(Content.Empty, content) @@ -69,7 +69,7 @@ class FunctionTest { assertTrue(members.none()) assertTrue(links.none()) } - assertEquals("Unit", details.elementAt(3).name) + assertEquals("Unit", details.elementAt(4).name) assertTrue(members.none()) assertTrue(links.none()) @@ -85,7 +85,7 @@ class FunctionTest { assertEquals("public", details.elementAt(0).name) assertEquals("final", details.elementAt(1).name) - with(details.elementAt(2)) { + with(details.elementAt(3)) { assertEquals("T", name) assertEquals(NodeKind.TypeParameter, kind) assertEquals(Content.Empty, content) @@ -100,14 +100,14 @@ class FunctionTest { assertTrue(members.none()) assertTrue(links.none()) } - with(details.elementAt(3)) { + with(details.elementAt(4)) { assertEquals("R", name) assertEquals(NodeKind.TypeParameter, kind) assertEquals(Content.Empty, content) assertTrue(members.none()) assertTrue(links.none()) } - assertEquals("Unit", details.elementAt(4).name) + assertEquals("Unit", details.elementAt(5).name) assertTrue(members.none()) assertTrue(links.none()) @@ -126,7 +126,7 @@ Documentation""", content.description.toTestString()) assertEquals("public", details.elementAt(0).name) assertEquals("final", details.elementAt(1).name) - with(details.elementAt(2)) { + with(details.elementAt(3)) { assertEquals("x", name) assertEquals(NodeKind.Parameter, kind) assertEquals("parameter", content.summary.toTestString()) @@ -134,7 +134,7 @@ Documentation""", content.description.toTestString()) assertTrue(members.none()) assertTrue(links.none()) } - assertEquals("Unit", details.elementAt(3).name) + assertEquals("Unit", details.elementAt(4).name) assertTrue(members.none()) assertTrue(links.none()) } @@ -167,8 +167,8 @@ Documentation""", content.description.toTestString()) @Test fun functionWithAnnotatedParam() { verifyModel("testdata/functions/functionWithAnnotatedParam.kt") { model -> - with(model.members.single().members.single { it.name == "function"} ) { - with(details.elementAt(2)) { + with(model.members.single().members.single { it.name == "function" }) { + with(details(NodeKind.Parameter).first()) { assertEquals(1, annotations.count()) with(annotations[0]) { assertEquals("Fancy", name) @@ -182,7 +182,7 @@ Documentation""", content.description.toTestString()) @Test fun functionWithNoinlineParam() { verifyPackageMember("testdata/functions/functionWithNoinlineParam.kt") { func -> - with(func.details.elementAt(2)) { + with(func.details(NodeKind.Parameter).first()) { val modifiers = details(NodeKind.Modifier).map { it.name } assertTrue("noinline" in modifiers) } @@ -191,7 +191,7 @@ Documentation""", content.description.toTestString()) @Test fun annotatedFunctionWithAnnotationParameters() { verifyModel("testdata/functions/annotatedFunctionWithAnnotationParameters.kt") { model -> - with(model.members.single().members.single { it.name == "f"}) { + with(model.members.single().members.single { it.name == "f" }) { assertEquals(1, annotations.count()) with(annotations[0]) { assertEquals("Fancy", name) @@ -214,7 +214,7 @@ Documentation""", content.description.toTestString()) @Test fun functionWithDefaultParameter() { verifyModel("testdata/functions/functionWithDefaultParameter.kt") { model -> with(model.members.single().members.single()) { - with(details.elementAt(2)) { + with(details.elementAt(3)) { val value = details(NodeKind.Value) assertEquals(1, value.count()) with(value[0]) { |