Make several tests running on JS backend.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user