diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-08-12 14:26:45 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-17 11:55:35 +0200 |
commit | 785d741790f653d5c260f59c9d8875bbfde2dc07 (patch) | |
tree | 9c5bac1028d4ddeffb9101e1776563f1882d5ccb /plugins/base/src/test | |
parent | 09004d828b5640b1471309f9e537ca64a28affd3 (diff) | |
download | dokka-785d741790f653d5c260f59c9d8875bbfde2dc07.tar.gz dokka-785d741790f653d5c260f59c9d8875bbfde2dc07.tar.bz2 dokka-785d741790f653d5c260f59c9d8875bbfde2dc07.zip |
Fix generic supertypes to hold TypeParameters
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r-- | plugins/base/src/test/kotlin/basic/DRITest.kt | 2 | ||||
-rw-r--r-- | plugins/base/src/test/kotlin/model/ClassesTest.kt | 12 | ||||
-rw-r--r-- | plugins/base/src/test/kotlin/model/JavaTest.kt | 6 | ||||
-rw-r--r-- | plugins/base/src/test/kotlin/utils/TestUtils.kt | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/plugins/base/src/test/kotlin/basic/DRITest.kt b/plugins/base/src/test/kotlin/basic/DRITest.kt index 559a2dbf..353991ba 100644 --- a/plugins/base/src/test/kotlin/basic/DRITest.kt +++ b/plugins/base/src/test/kotlin/basic/DRITest.kt @@ -271,7 +271,7 @@ class DRITest : AbstractCoreTest() { val foo = sampleInner.children.first { it.name == "foo" } as MemberPageNode val documentable = foo.documentable as DFunction - assertEquals(sampleClass.dri.first().toString(), (documentable.type as OtherParameter).declarationDRI.toString()) + assertEquals(sampleClass.dri.first().toString(), (documentable.type as TypeParameter).declarationDRI.toString()) assertEquals(0, documentable.generics.size) } } diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index 1bf55235..bb7bac2d 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -221,7 +221,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class with((this / "f").cast<DFunction>()) { modifier.values.forEach { it equals Open } } - D.supertypes.flatMap { it.component2() }.firstOrNull()?.dri equals C.dri + D.supertypes.flatMap { it.component2() }.firstOrNull()?.typeConstructor?.dri equals C.dri } } } @@ -258,8 +258,8 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class modifier.values.forEach { it equals Final } } - D.supers.single().dri equals C.dri - E.supers.single().dri equals D.dri + D.supers.single().typeConstructor.dri equals C.dri + E.supers.single().typeConstructor.dri equals D.dri } } @@ -496,7 +496,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class """.trimIndent() ){ with((this / "classes" / "Tested").cast<DClass>()){ - extra[ImplementedInterfaces]?.interfaces?.entries?.single()?.value?.map { it.sureClassNames }?.sorted() equals listOf("Highest", "Lower", "LowerImplInterface").sorted() + extra[ImplementedInterfaces]?.interfaces?.entries?.single()?.value?.map { it.dri.sureClassNames }?.sorted() equals listOf("Highest", "Lower", "LowerImplInterface").sorted() } } } @@ -510,7 +510,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class """.trimIndent() ) { with((this / "classes" / "Tested").cast<DClass>()) { - supertypes.entries.single().value.map { it.dri.sureClassNames }.single() equals "B" + supertypes.entries.single().value.map { it.typeConstructor.dri.sureClassNames }.single() equals "B" } } } @@ -526,7 +526,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class """.trimIndent() ){ with((this / "classes" / "Tested").cast<DClass>()) { - supertypes.entries.single().value.map { it.dri.sureClassNames to it.kind }.sortedBy { it.first } equals listOf("B" to KotlinClassKindTypes.CLASS, "Y" to KotlinClassKindTypes.INTERFACE) + supertypes.entries.single().value.map { it.typeConstructor.dri.sureClassNames to it.kind }.sortedBy { it.first } equals listOf("B" to KotlinClassKindTypes.CLASS, "Y" to KotlinClassKindTypes.INTERFACE) } } } diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index 237131d3..4e9b9de4 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -49,7 +49,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |class Tested extends Extendable implements Lower { } """){ with((this / "java" / "Tested").cast<DClass>()){ - extra[ImplementedInterfaces]?.interfaces?.entries?.single()?.value?.map { it.sureClassNames }?.sorted() equals listOf("Highest", "Lower").sorted() + extra[ImplementedInterfaces]?.interfaces?.entries?.single()?.value?.map { it.dri.sureClassNames }?.sorted() equals listOf("Highest", "Lower").sorted() } } } @@ -63,7 +63,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { |class Tested extends Extendable implements Lower { } """){ with((this / "java" / "Tested").cast<DClass>()) { - supertypes.entries.single().value.map { it.dri.sureClassNames to it.kind }.sortedBy { it.first } equals listOf("Extendable" to JavaClassKindTypes.CLASS, "Lower" to JavaClassKindTypes.INTERFACE) + supertypes.entries.single().value.map { it.typeConstructor.dri.sureClassNames to it.kind }.sortedBy { it.first } equals listOf("Extendable" to JavaClassKindTypes.CLASS, "Lower" to JavaClassKindTypes.INTERFACE) } } } @@ -98,7 +98,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { with((this / "java" / "Foo").cast<DClass>()) { val sups = listOf("Exception", "Cloneable") assertTrue( - sups.all { s -> supertypes.values.flatten().any { it.dri.classNames == s } }) + sups.all { s -> supertypes.values.flatten().any { it.typeConstructor.dri.classNames == s } }) "Foo must extend ${sups.joinToString(", ")}" } } diff --git a/plugins/base/src/test/kotlin/utils/TestUtils.kt b/plugins/base/src/test/kotlin/utils/TestUtils.kt index bd0e1fe2..5183972a 100644 --- a/plugins/base/src/test/kotlin/utils/TestUtils.kt +++ b/plugins/base/src/test/kotlin/utils/TestUtils.kt @@ -69,7 +69,7 @@ val DClass.supers val Bound.name: String? get() = when (this) { is Nullable -> inner.name - is OtherParameter -> name + is TypeParameter -> name is PrimitiveJavaType -> name is TypeConstructor -> dri.classNames is JavaObject -> "Object" |