aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/utilities
diff options
context:
space:
mode:
authorVsevolod Tolstopyatov <qwwdfsad@gmail.com>2023-08-14 19:45:32 +0200
committerGitHub <noreply@github.com>2023-08-14 19:45:32 +0200
commit2269ac5e003b1cce90742b5f5ed9cd294dd099f4 (patch)
treeb90bdab54c9ce0b144ed4485905e5257f174a58b /core/src/test/kotlin/utilities
parent2fd8e9096706545f8b77e1e66bcc876d7e29f82c (diff)
downloaddokka-2269ac5e003b1cce90742b5f5ed9cd294dd099f4.tar.gz
dokka-2269ac5e003b1cce90742b5f5ed9cd294dd099f4.tar.bz2
dokka-2269ac5e003b1cce90742b5f5ed9cd294dd099f4.zip
Refactor and document DisplaySourceSet, deprecate SelfRepresentingSingletonSet (#3105)
* Deprecate internal API SelfRepresentingSingletonSet for removal as being harmful and unimplement it in DisplaySourceSet * Provide no automatic migration for DisplaySourceSet, as there are no mechanisms for that. Manual migration is the replacement of 'dss' to `setOf(dss)` where applicable * Introduce a convenience-member DefaultRenderer.buildContentNode to avoid wrapping DSS into set manually * Document DisplaySourceSet * Replace Iterable<DisplaySourceSet>.sourceSetIDs with more straightforward Iterable<DisplaySourceSet>.computeSourceSetIds(), refactor all the usages, save some allocations * Start caching CompositeSourceSetID properties to avoid excessive allocations * Update integration tests on the latest revision with Knit version where the workaround is applied Fixes #2897
Diffstat (limited to 'core/src/test/kotlin/utilities')
-rw-r--r--core/src/test/kotlin/utilities/SelfRepresentingSingletonSetTest.kt60
1 files changed, 0 insertions, 60 deletions
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()
- )
- }
-}