sort and binarySearch methods now have correct default toIndex parameter #KT-4963 Fixed

This commit is contained in:
Ilya Ryzhenkov
2014-05-07 17:11:54 +04:00
committed by Andrey Breslav
parent 9ec78a437d
commit 178ae83e8d
3 changed files with 26 additions and 18 deletions
@@ -5,6 +5,14 @@ import org.junit.Test as test
class ArraysJVMTest {
test fun sort() {
var a = intArray(5, 2, 1, 4, 3)
var b = intArray(1, 2, 3, 4, 5)
a.sort()
for (i in a.indices)
expect(b[i]) { a[i] }
}
test fun copyOf() {
checkContent(booleanArray(true, false, true, false, true, false).copyOf().iterator(), 6) { it % 2 == 0 }
checkContent(byteArray(0, 1, 2, 3, 4, 5).copyOf().iterator(), 6) { it.toByte() }