Unit tests for kotlin.collections


#1

Are there any publicly available? They would be very useful when creating custom implementations.


#2

You can take a look at collection related unit tests in Kotlin Standard Library, but these are mostly tests for collection extension functions, and not for collection implementations: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib/test/collections

Since Kotlin uses standard JDK collection implementations, we do not test them as they are already tested in JDK.

And when we do provide our own special implemetations, we just ensure they have the same behavior as JDK implementations, like in the following tests (specialLists, specialSets, specialMaps): https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/test/collections/CollectionTest.kt#L835