Make several tests running on JS backend.

This commit is contained in:
Ilya Gorbunov
2016-11-17 01:58:43 +03:00
parent 0899a0fdda
commit 62fe89b536
16 changed files with 48 additions and 196 deletions
@@ -1,11 +1,8 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
import java.util.*
// WITH_RUNTIME
fun box(): String {
val list = ArrayList(Arrays.asList(3, 2, 4, 8, 1, 5))
val expected = ArrayList(Arrays.asList(8, 5, 4, 3, 2, 1))
Collections.sort(list, Comparator { a, b -> b - a })
val list = mutableListOf(3, 2, 4, 8, 1, 5)
val expected = listOf(8, 5, 4, 3, 2, 1)
list.sortWith(Comparator { a, b -> b - a })
return if (list == expected) "OK" else list.toString()
}
@@ -1,12 +1,9 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
import java.util.*
// WITH_RUNTIME
fun box(): String {
val list = ArrayList(Arrays.asList(3, 2, 4, 8, 1, 5))
val expected = ArrayList(Arrays.asList(8, 5, 4, 3, 2, 1))
val list = mutableListOf(3, 2, 4, 8, 1, 5)
val expected = listOf(8, 5, 4, 3, 2, 1)
val comparatorFun: (Int, Int) -> Int = { a, b -> b - a }
Collections.sort(list, Comparator(comparatorFun))
list.sortWith(Comparator(comparatorFun))
return if (list == expected) "OK" else list.toString()
}