JS stdlib: added LinkedHashMap abd LinkedHashSet.
This commit is contained in:
@@ -16,6 +16,11 @@ class PrimitiveMapJsTest : MapJsTest() {
|
||||
override fun emptyMutableMap(): MutableMap<String, Int> = HashMap()
|
||||
}
|
||||
|
||||
class LinkedHashMapTest : MapJsTest() {
|
||||
override fun <T : kotlin.Comparable<T>> Collection<T>.toNormalizedList(): List<T> = this.toList()
|
||||
override fun emptyMutableMap(): MutableMap<String, Int> = LinkedHashMap()
|
||||
}
|
||||
|
||||
abstract class MapJsTest {
|
||||
//TODO: replace `array(...).toList()` to `listOf(...)`
|
||||
val KEYS = array("zero", "one", "two", "three").toList()
|
||||
|
||||
@@ -3,6 +3,7 @@ package test.collections
|
||||
import kotlin.test.*
|
||||
import org.junit.Test
|
||||
import java.util.HashSet
|
||||
import java.util.LinkedHashSet
|
||||
|
||||
class ComplexSetJsTest : SetJsTest() {
|
||||
// hashSetOf returns ComlpexHashSet because it is Generic
|
||||
@@ -13,6 +14,10 @@ class PrimitiveSetJsTest : SetJsTest() {
|
||||
override fun createEmptyMutableSet(): MutableSet<String> = HashSet<String>()
|
||||
}
|
||||
|
||||
class LinkedHashSetTest : SetJsTest() {
|
||||
override fun createEmptyMutableSet(): MutableSet<String> = LinkedHashSet<String>()
|
||||
}
|
||||
|
||||
abstract class SetJsTest {
|
||||
val data: Set<String> = createTestMutableSet()
|
||||
val empty: Set<String> = createEmptyMutableSet()
|
||||
|
||||
Reference in New Issue
Block a user