diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-06-05 09:07:20 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-06-10 10:52:43 +0200 |
commit | e9fd8b7bc00491b50e4822acc82e5615ab0bde3b (patch) | |
tree | 27648e766764df986a154e6c3353d634d219c0bc /core/src/test/kotlin/model | |
parent | 77c8777b7f66bddd374d68decd507547d356d602 (diff) | |
download | dokka-e9fd8b7bc00491b50e4822acc82e5615ab0bde3b.tar.gz dokka-e9fd8b7bc00491b50e4822acc82e5615ab0bde3b.tar.bz2 dokka-e9fd8b7bc00491b50e4822acc82e5615ab0bde3b.zip |
Implement `reportUndocumented` option to report undocumented code
Diffstat (limited to 'core/src/test/kotlin/model')
-rw-r--r-- | core/src/test/kotlin/model/DocumentableTest.kt | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/core/src/test/kotlin/model/DocumentableTest.kt b/core/src/test/kotlin/model/DocumentableTest.kt new file mode 100644 index 00000000..e3031a50 --- /dev/null +++ b/core/src/test/kotlin/model/DocumentableTest.kt @@ -0,0 +1,108 @@ +package model + +import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.* +import org.jetbrains.dokka.model.properties.PropertyContainer +import kotlin.test.Test +import kotlin.test.assertEquals + +class DocumentableTest { + + @Test + fun withDescendents() { + val dClass = DClass( + dri = DRI(), + name = "TestClass", + constructors = emptyList(), + classlikes = emptyList(), + companion = null, + documentation = emptyMap(), + expectPresentInSet = null, + extra = PropertyContainer.empty(), + visibility = emptyMap(), + generics = emptyList(), + modifier = emptyMap(), + properties = emptyList(), + sources = emptyMap(), + sourceSets = emptyList(), + supertypes = emptyMap(), + functions = listOf( + DFunction( + dri = DRI(), + name = "function0", + documentation = emptyMap(), + expectPresentInSet = null, + extra = PropertyContainer.empty(), + visibility = emptyMap(), + generics = emptyList(), + modifier = emptyMap(), + sources = emptyMap(), + sourceSets = emptyList(), + type = Void, + receiver = null, + isConstructor = false, + parameters = listOf( + DParameter( + dri = DRI(), + name = "f0p0", + documentation = emptyMap(), + expectPresentInSet = null, + extra = PropertyContainer.empty(), + sourceSets = emptyList(), + type = Void + ), + DParameter( + dri = DRI(), + name = "f0p1", + documentation = emptyMap(), + expectPresentInSet = null, + extra = PropertyContainer.empty(), + sourceSets = emptyList(), + type = Void + ) + ) + ), + DFunction( + dri = DRI(), + name = "function1", + documentation = emptyMap(), + expectPresentInSet = null, + extra = PropertyContainer.empty(), + visibility = emptyMap(), + generics = emptyList(), + modifier = emptyMap(), + sources = emptyMap(), + sourceSets = emptyList(), + type = Void, + receiver = null, + isConstructor = false, + parameters = listOf( + DParameter( + dri = DRI(), + name = "f1p0", + documentation = emptyMap(), + expectPresentInSet = null, + extra = PropertyContainer.empty(), + sourceSets = emptyList(), + type = Void + ), + DParameter( + dri = DRI(), + name = "f1p1", + documentation = emptyMap(), + expectPresentInSet = null, + extra = PropertyContainer.empty(), + sourceSets = emptyList(), + type = Void + ) + ) + ) + ) + ) + + assertEquals( + listOf("TestClass", "function0", "f0p0", "f0p1", "function1", "f1p0", "f1p1"), + dClass.withDescendants().map { it.name }.toList() + ) + } +}
\ No newline at end of file |