diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-09-29 11:06:02 +0200 |
---|---|---|
committer | Andrzej Ratajczak <32793002+BarkingBad@users.noreply.github.com> | 2020-09-29 11:39:10 +0200 |
commit | 7e572b6341bc7da3eeed4aef41665097ebad9f35 (patch) | |
tree | eeb74c64b1e1a6f4a1e96f557965b7a6f10e4be9 /plugins/base/src | |
parent | 64ec7ad22e9541b639e854aa413a2cffd650e8d0 (diff) | |
download | dokka-7e572b6341bc7da3eeed4aef41665097ebad9f35.tar.gz dokka-7e572b6341bc7da3eeed4aef41665097ebad9f35.tar.bz2 dokka-7e572b6341bc7da3eeed4aef41665097ebad9f35.zip |
Fix failing tests
Diffstat (limited to 'plugins/base/src')
4 files changed, 15 insertions, 11 deletions
diff --git a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt index bf78b847..d5779b61 100644 --- a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt @@ -132,7 +132,7 @@ class ContentForAnnotationsTest : AbstractCoreTest() { pagesTransformationStage = { module -> val page = module.children.single { it.name == "test" } as PackagePageNode page.content.assertNode { - propertySignature(emptyMap(), "", "", emptySet(), "val", "property", "Int") + propertySignature(emptyMap(), "", "", emptySet(), "val", "property", "Int", "6") } } } @@ -155,7 +155,7 @@ class ContentForAnnotationsTest : AbstractCoreTest() { pagesTransformationStage = { module -> val page = module.children.single { it.name == "test" } as PackagePageNode page.content.assertNode { - propertySignature(mapOf("Fancy" to emptySet()), "", "", emptySet(), "val", "property", "Int") + propertySignature(mapOf("Fancy" to emptySet()), "", "", emptySet(), "val", "property", "Int", "6") } } } @@ -212,7 +212,7 @@ class ContentForAnnotationsTest : AbstractCoreTest() { "reportedBy", "showStopper" ) - ), "", "", emptySet(), "val", "ltint", "Int" + ), "", "", emptySet(), "val", "ltint", "Int", "5" ) } } diff --git a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt index 908109bf..b4c2623c 100644 --- a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt +++ b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt @@ -310,7 +310,7 @@ class ContentForSignaturesTest : AbstractCoreTest() { pagesTransformationStage = { module -> val page = module.children.single { it.name == "test" } as PackagePageNode page.content.assertNode { - propertySignature(emptyMap(), "", "", emptySet(), "val", "property", "Int") + propertySignature(emptyMap(), "", "", emptySet(), "val", "property", "Int", "6") } } } @@ -329,7 +329,7 @@ class ContentForSignaturesTest : AbstractCoreTest() { pagesTransformationStage = { module -> val page = module.children.single { it.name == "test" } as PackagePageNode page.content.assertNode { - propertySignature(emptyMap(), "", "", setOf("const"), "val", "property", "Int") + propertySignature(emptyMap(), "", "", setOf("const"), "val", "property", "Int", "6") } } } @@ -348,7 +348,7 @@ class ContentForSignaturesTest : AbstractCoreTest() { pagesTransformationStage = { module -> val page = module.children.single { it.name == "test" } as PackagePageNode page.content.assertNode { - propertySignature(emptyMap(), "protected", "", emptySet(), "val", "property", "Int") + propertySignature(emptyMap(), "protected", "", emptySet(), "val", "property", "Int", "6") } } } @@ -367,7 +367,7 @@ class ContentForSignaturesTest : AbstractCoreTest() { pagesTransformationStage = { module -> val page = module.children.single { it.name == "test" } as PackagePageNode page.content.assertNode { - propertySignature(emptyMap(), "protected", "", setOf("lateinit"), "var", "property", "Int") + propertySignature(emptyMap(), "protected", "", setOf("lateinit"), "var", "property", "Int", "6") } } } diff --git a/plugins/base/src/test/kotlin/signatures/ObviousTypeSkippingTest.kt b/plugins/base/src/test/kotlin/signatures/ObviousTypeSkippingTest.kt index e8265667..dfd80a54 100644 --- a/plugins/base/src/test/kotlin/signatures/ObviousTypeSkippingTest.kt +++ b/plugins/base/src/test/kotlin/signatures/ObviousTypeSkippingTest.kt @@ -54,8 +54,8 @@ class ObviousTypeSkippingTest : AbstractCoreTest( forFunction("fun <T> underTest(arg: T) {}", "fun <T> underTest(arg: T)"), forFunction("fun <T: Any> underTest(arg: T) {}", "fun <T : Any> underTest(arg: T)"), forFunction("fun <T: Any?> underTest(arg: T) {}", "fun <T> underTest(arg: T)"), - forProperty("val underTest: Int = 5", "val underTest: Int"), - forProperty("val underTest = 5", "val underTest: Int"), + forProperty("val underTest: Int = 5", "val underTest: Int = 5"), + forProperty("val underTest = 5", "val underTest: Int = 5"), forProperty("val underTest: Unit = println(5)", "val underTest: Unit"), forProperty("val underTest = println(5)", "val underTest: Unit"), forProperty("val underTest: Unit? = if (true) println(5) else null", "val underTest: Unit?"), @@ -192,4 +192,4 @@ private fun forClass(codeFragment: String, expectedSignature: String, className: expectedSignature, OnParentPage(PackagePageNode::class, ContentKind.Classlikes), OnOwnPage(className) - )
\ No newline at end of file + ) diff --git a/plugins/base/src/test/kotlin/utils/contentUtils.kt b/plugins/base/src/test/kotlin/utils/contentUtils.kt index 7fcd8e89..4cb3cfea 100644 --- a/plugins/base/src/test/kotlin/utils/contentUtils.kt +++ b/plugins/base/src/test/kotlin/utils/contentUtils.kt @@ -129,7 +129,8 @@ fun ContentMatcherBuilder<*>.propertySignature( keywords: Set<String>, preposition: String, name: String, - type: String? = null + type: String? = null, + value: String? = null ) { group { header { +"Package test" } @@ -159,6 +160,9 @@ fun ContentMatcherBuilder<*>.propertySignature( } } } + if (type != null) { + +(" = $value") + } } } } |