aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/kotlin/model/CompositeSourceSetIDTest.kt6
-rw-r--r--core/src/test/kotlin/model/DisplaySourceSetTest.kt10
-rw-r--r--core/src/test/kotlin/utilities/SelfRepresentingSingletonSetTest.kt60
3 files changed, 9 insertions, 67 deletions
diff --git a/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt b/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt
index 472581e7..aa5a801d 100644
--- a/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt
+++ b/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt
@@ -2,7 +2,6 @@ package model
import org.jetbrains.dokka.DokkaSourceSetID
import org.jetbrains.dokka.model.CompositeSourceSetID
-import org.jetbrains.dokka.model.plus
import kotlin.test.*
class CompositeSourceSetIDTest {
@@ -65,4 +64,9 @@ class CompositeSourceSetIDTest {
"Expected all three source sets being merged in order"
)
}
+
+ operator fun DokkaSourceSetID.plus(other: DokkaSourceSetID): CompositeSourceSetID {
+ return CompositeSourceSetID(listOf(this, other))
+ }
+
}
diff --git a/core/src/test/kotlin/model/DisplaySourceSetTest.kt b/core/src/test/kotlin/model/DisplaySourceSetTest.kt
index adabdbdb..04ad07d6 100644
--- a/core/src/test/kotlin/model/DisplaySourceSetTest.kt
+++ b/core/src/test/kotlin/model/DisplaySourceSetTest.kt
@@ -2,9 +2,7 @@ package model
import org.jetbrains.dokka.DokkaSourceSetID
import org.jetbrains.dokka.Platform
-import org.jetbrains.dokka.model.CompositeSourceSetID
-import org.jetbrains.dokka.model.DisplaySourceSet
-import org.jetbrains.dokka.model.sourceSetIDs
+import org.jetbrains.dokka.model.*
import kotlin.test.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue
@@ -44,17 +42,17 @@ class DisplaySourceSetTest {
)
assertFalse(
- DokkaSourceSetID("m3", "s3") in listOf(contentSourceSet).sourceSetIDs,
+ DokkaSourceSetID("m3", "s3") in listOf(contentSourceSet).computeSourceSetIds(),
"Expected source set id not being contained in content source set"
)
assertTrue(
- DokkaSourceSetID("m1", "s1") in listOf(contentSourceSet).sourceSetIDs,
+ DokkaSourceSetID("m1", "s1") in listOf(contentSourceSet).computeSourceSetIds(),
"Expected source set id being contained in content source set"
)
assertTrue(
- DokkaSourceSetID("m1+m2", "s1+s2") in listOf(contentSourceSet).sourceSetIDs,
+ DokkaSourceSetID("m1+m2", "s1+s2") in listOf(contentSourceSet).computeSourceSetIds(),
"Expected merged source set being contained in content source set"
)
}
diff --git a/core/src/test/kotlin/utilities/SelfRepresentingSingletonSetTest.kt b/core/src/test/kotlin/utilities/SelfRepresentingSingletonSetTest.kt
deleted file mode 100644
index bef43565..00000000
--- a/core/src/test/kotlin/utilities/SelfRepresentingSingletonSetTest.kt
+++ /dev/null
@@ -1,60 +0,0 @@
-package utilities
-
-import org.jetbrains.dokka.utilities.SelfRepresentingSingletonSet
-import kotlin.test.Test
-import kotlin.test.assertEquals
-import kotlin.test.assertFalse
-import kotlin.test.assertTrue
-
-class SelfRepresentingSingletonSetTest {
-
- data class TestModel(val index: Int = 0) : SelfRepresentingSingletonSet<TestModel>
-
- @Test
- fun size() {
- assertEquals(1, TestModel().size)
- }
-
- @Test
- fun contains() {
- val m0 = TestModel(0)
- val m1 = TestModel(1)
-
- assertFalse(m1 in m0)
- assertFalse(m0 in m1)
- assertTrue(m0 in m0)
- assertTrue(m1 in m1)
- assertTrue(TestModel(0) in m0)
- }
-
- @Test
- fun `containsAll is compliant to setOf`() {
- val setOf = setOf(TestModel())
- val testModel = TestModel()
-
- assertEquals(
- setOf.containsAll(emptyList()), testModel.containsAll(emptyList())
- )
-
- assertEquals(
- setOf.containsAll(listOf(TestModel())), testModel.containsAll(listOf(TestModel()))
- )
-
- assertEquals(
- setOf.containsAll(listOf(TestModel(0), TestModel(1))),
- testModel.containsAll(listOf(TestModel(0), TestModel(1)))
- )
- }
-
- @Test
- fun isEmpty() {
- assertFalse(TestModel().isEmpty())
- }
-
- @Test
- fun iterator() {
- assertEquals(
- listOf(TestModel()), TestModel(0).iterator().asSequence().toList()
- )
- }
-}