Refactor Map-InternalMap to provide specialized linked string map and set
This commit is contained in:
@@ -55,7 +55,7 @@ class PrimitiveMapJsTest : MapJsTest() {
|
||||
}
|
||||
}
|
||||
|
||||
class LinkedHashMapTest : MapJsTest() {
|
||||
class LinkedHashMapJsTest : MapJsTest() {
|
||||
@test override fun constructors() {
|
||||
LinkedHashMap<String, Int>()
|
||||
LinkedHashMap<String, Int>(3)
|
||||
@@ -72,6 +72,19 @@ class LinkedHashMapTest : MapJsTest() {
|
||||
override fun emptyMutableMapWithNullableKeyValue(): MutableMap<String?, Int?> = LinkedHashMap()
|
||||
}
|
||||
|
||||
class LinkedPrimitiveMapJsTest : MapJsTest() {
|
||||
@test override fun constructors() {
|
||||
val map = createTestMap()
|
||||
|
||||
assertEquals(KEYS.toNormalizedList(), map.keys.toNormalizedList())
|
||||
assertEquals(VALUES.toNormalizedList(), map.values.toNormalizedList())
|
||||
}
|
||||
|
||||
override fun <T : kotlin.Comparable<T>> Collection<T>.toNormalizedList(): List<T> = this.toList()
|
||||
override fun emptyMutableMap(): MutableMap<String, Int> = linkedStringMapOf()
|
||||
override fun emptyMutableMapWithNullableKeyValue(): MutableMap<String?, Int?> = LinkedHashMap()
|
||||
}
|
||||
|
||||
abstract class MapJsTest {
|
||||
val KEYS = listOf("zero", "one", "two", "three")
|
||||
val VALUES = arrayOf(0, 1, 2, 3).toList()
|
||||
|
||||
Reference in New Issue
Block a user