aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-11-10 11:46:54 +0100
committerGitHub <noreply@github.com>2023-11-10 11:46:54 +0100
commit8e5c63d035ef44a269b8c43430f43f5c8eebfb63 (patch)
tree1b915207b2b9f61951ddbf0ff2e687efd053d555 /core/src/test/kotlin/model/CompositeSourceSetIDTest.kt
parenta44efd4ba0c2e4ab921ff75e0f53fc9335aa79db (diff)
downloaddokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.gz
dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.bz2
dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.zip
Restructure the project to utilize included builds (#3174)
* Refactor and simplify artifact publishing * Update Gradle to 8.4 * Refactor and simplify convention plugins and build scripts Fixes #3132 --------- Co-authored-by: Adam <897017+aSemy@users.noreply.github.com> Co-authored-by: Oleg Yukhnevich <whyoleg@gmail.com>
Diffstat (limited to 'core/src/test/kotlin/model/CompositeSourceSetIDTest.kt')
-rw-r--r--core/src/test/kotlin/model/CompositeSourceSetIDTest.kt76
1 files changed, 0 insertions, 76 deletions
diff --git a/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt b/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt
deleted file mode 100644
index 261ca325..00000000
--- a/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package model
-
-import org.jetbrains.dokka.DokkaSourceSetID
-import org.jetbrains.dokka.model.CompositeSourceSetID
-import kotlin.test.*
-
-class CompositeSourceSetIDTest {
-
- @Test
- fun `constructor fails with empty collection`() {
- assertFailsWith<IllegalArgumentException>("Expected no construction of empty `CompositeSourceSetID`") {
- CompositeSourceSetID(emptyList())
- }
- }
-
- @Test
- fun `merged for single source set`() {
- val sourceSetID = DokkaSourceSetID("module", "sourceSet")
- val composite = CompositeSourceSetID(sourceSetID)
-
- assertEquals(
- composite.merged, sourceSetID,
- "Expected merged source set id to be equal to single child"
- )
- }
-
- @Test
- fun `merged with multiple source sets`() {
- val composite = CompositeSourceSetID(
- listOf(DokkaSourceSetID("m1", "s1"), DokkaSourceSetID("m2", "s2"), DokkaSourceSetID("m3", "s3"))
- )
-
- assertEquals(
- DokkaSourceSetID("m1+m2+m3", "s1+s2+s3"), composite.merged,
- "Expected merged source set id to concatenate source sets"
- )
- }
-
- @Test
- fun `contains with child sourceSetID`() {
- val composite = CompositeSourceSetID(listOf(DokkaSourceSetID("m1", "s1"), DokkaSourceSetID("m2", "s2")))
-
- assertFalse(
- DokkaSourceSetID("m3", "s3") in composite,
- "Expected source set id not being contained in composite"
- )
-
- assertTrue(
- DokkaSourceSetID("m1", "s1") in composite,
- "Expected child source set id being contained in composite"
- )
-
- assertTrue(
- DokkaSourceSetID("m1+m2", "s1+s2") in composite,
- "Expected merged source set id being contained in composite"
- )
- }
-
- @Test
- fun `plus operator`() {
- val composite = DokkaSourceSetID("m1", "s1") + DokkaSourceSetID("m2", "s2") + DokkaSourceSetID("m3", "s3")
- assertEquals(
- DokkaSourceSetID("m1+m2+m3", "s1+s2+s3"), composite.merged,
- "Expected all three source sets being merged in order"
- )
- }
-
- operator fun DokkaSourceSetID.plus(other: DokkaSourceSetID): CompositeSourceSetID {
- return CompositeSourceSetID(listOf(this, other))
- }
-
-}