diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-12 02:41:12 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-12 02:41:12 +0400 |
commit | 5b24912e46d831434b8b4a12b0aedcf2b06c77e1 (patch) | |
tree | b48e394dc3f8bebcdea06a10cc7195c8fe4515cf /test/src/model | |
parent | e155d101a52f62b0c8c10778fdf0068549b413be (diff) | |
download | dokka-5b24912e46d831434b8b4a12b0aedcf2b06c77e1.tar.gz dokka-5b24912e46d831434b8b4a12b0aedcf2b06c77e1.tar.bz2 dokka-5b24912e46d831434b8b4a12b0aedcf2b06c77e1.zip |
Fix tests after adding type/upperbound information to model.
Diffstat (limited to 'test/src/model')
-rw-r--r-- | test/src/model/ClassTest.kt | 21 | ||||
-rw-r--r-- | test/src/model/FunctionTest.kt | 27 | ||||
-rw-r--r-- | test/src/model/PropertyTest.kt | 18 |
3 files changed, 34 insertions, 32 deletions
diff --git a/test/src/model/ClassTest.kt b/test/src/model/ClassTest.kt index 82d24f16..8032b928 100644 --- a/test/src/model/ClassTest.kt +++ b/test/src/model/ClassTest.kt @@ -18,22 +18,13 @@ public class ClassTest { } } - Test fun genericClass() { - verifyModel("test/data/classes/genericClass.kt") { model -> + Test fun gnClass() { + verifyModel("test/data/classes/emptyClass.kt") { model -> with(model.nodes.single().members.single()) { assertEquals(DocumentationNodeKind.Class, kind) assertEquals("Klass", name) assertEquals("", doc) - - with(details.single()) { - assertEquals("T", name) - assertEquals(DocumentationNodeKind.TypeParameter, kind) - assertEquals("", doc) - assertTrue(details.none()) - assertTrue(members.none()) - assertTrue(links.none()) - } - + assertTrue(details.none()) assertEquals("<init>", members.single().name) assertTrue(links.none()) } @@ -72,7 +63,7 @@ public class ClassTest { assertEquals("name", name) assertEquals(DocumentationNodeKind.Parameter, kind) assertEquals("", doc) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(links.none()) assertTrue(members.none()) } @@ -105,7 +96,7 @@ public class ClassTest { assertEquals("fn", name) assertEquals("", doc) assertEquals(DocumentationNodeKind.Function, kind) - assertTrue(details.none()) + assertEquals("Unit", details.single().name) assertTrue(links.none()) assertTrue(members.none()) } @@ -135,7 +126,7 @@ public class ClassTest { assertEquals("name", name) assertEquals("", doc) assertEquals(DocumentationNodeKind.Property, kind) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(members.none()) assertTrue(links.none()) } diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt index aa22ee0f..641b70a7 100644 --- a/test/src/model/FunctionTest.kt +++ b/test/src/model/FunctionTest.kt @@ -11,7 +11,7 @@ public class FunctionTest { assertEquals("fn", name) assertEquals(DocumentationNodeKind.Function, kind) assertEquals("Function fn", doc) - assertTrue(details.none()) + assertEquals("Unit", details.single().name) assertTrue(members.none()) assertTrue(links.none()) } @@ -24,11 +24,14 @@ public class FunctionTest { assertEquals("fn", name) assertEquals(DocumentationNodeKind.Function, kind) assertEquals("Function with receiver", doc) - with(details.single()) { + assertEquals("Unit", details.elementAt(0).name) + + assertEquals(2, details.count()) + with(details.elementAt(1)) { assertEquals("<this>", name) assertEquals(DocumentationNodeKind.Receiver, kind) assertEquals("", doc) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(members.none()) assertTrue(links.none()) } @@ -45,7 +48,9 @@ public class FunctionTest { assertEquals(DocumentationNodeKind.Function, kind) assertEquals("generic function", doc) - with(details.single()) { + assertEquals(2, details.count()) + assertEquals("Unit", details.elementAt(0).name) + with(details.elementAt(1)) { assertEquals("T", name) assertEquals(DocumentationNodeKind.TypeParameter, kind) assertEquals("", doc) @@ -66,8 +71,9 @@ public class FunctionTest { assertEquals(DocumentationNodeKind.Function, kind) assertEquals("generic function", doc) - assertEquals(2, details.count()) - with(details.elementAt(0)) { + assertEquals(3, details.count()) + assertEquals("Unit", details.elementAt(0).name) + with(details.elementAt(1)) { assertEquals("T", name) assertEquals(DocumentationNodeKind.TypeParameter, kind) assertEquals("", doc) @@ -82,7 +88,7 @@ public class FunctionTest { assertTrue(members.none()) assertTrue(links.none()) } - with(details.elementAt(1)) { + with(details.elementAt(2)) { assertEquals("R", name) assertEquals(DocumentationNodeKind.TypeParameter, kind) assertEquals("", doc) @@ -105,11 +111,14 @@ public class FunctionTest { Function Documentation""" , doc) - with(details.single()) { + + assertEquals(2, details.count()) + assertEquals("Unit", details.elementAt(0).name) + with(details.elementAt(1)) { assertEquals("x", name) assertEquals(DocumentationNodeKind.Parameter, kind) assertEquals("parameter", doc) - assertTrue(details.none()) + assertEquals("Int", details.single().name) assertTrue(members.none()) assertTrue(links.none()) } diff --git a/test/src/model/PropertyTest.kt b/test/src/model/PropertyTest.kt index 1d30f2ce..ed82bfec 100644 --- a/test/src/model/PropertyTest.kt +++ b/test/src/model/PropertyTest.kt @@ -11,7 +11,7 @@ public class PropertyTest { assertEquals("property", name) assertEquals(DocumentationNodeKind.Property, kind) assertEquals("", doc) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(members.none()) assertTrue(links.none()) } @@ -24,7 +24,7 @@ public class PropertyTest { assertEquals("property", name) assertEquals(DocumentationNodeKind.Property, kind) assertEquals("", doc) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(members.none()) assertTrue(links.none()) } @@ -37,13 +37,13 @@ public class PropertyTest { assertEquals("property", name) assertEquals(DocumentationNodeKind.Property, kind) assertEquals("", doc) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(links.none()) with(members.single()) { assertEquals("<get-property>", name) assertEquals(DocumentationNodeKind.Function, kind) assertEquals("", doc) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(links.none()) assertTrue(members.none()) } @@ -57,7 +57,7 @@ public class PropertyTest { assertEquals("property", name) assertEquals(DocumentationNodeKind.Property, kind) assertEquals("", doc) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(links.none()) assertEquals(2, members.count()) @@ -65,7 +65,7 @@ public class PropertyTest { assertEquals("<get-property>", name) assertEquals(DocumentationNodeKind.Function, kind) assertEquals("", doc) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(links.none()) assertTrue(members.none()) } @@ -73,11 +73,13 @@ public class PropertyTest { assertEquals("<set-property>", name) assertEquals(DocumentationNodeKind.Function, kind) assertEquals("", doc) - with(details.single()) { + assertEquals(2, details.count()) + assertEquals("Unit", details.elementAt(0).name) + with(details.elementAt(1)) { assertEquals("value", name) assertEquals(DocumentationNodeKind.Parameter, kind) assertEquals("", doc) - assertTrue(details.none()) + assertEquals("String", details.single().name) assertTrue(links.none()) assertTrue(members.none()) } |