Skip to content

Commit 863c65a

Browse files
committed
Move and fix implementation tests
1 parent 9c9ae9a commit 863c65a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package kotlinx.collections.immutable.implementations.immutableList
1818

19-
import org.junit.Test
20-
import java.util.*
2119
import kotlin.test.*
2220

2321
class BufferIteratorTest {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package kotlinx.collections.immutable.implementations.immutableList
1818

19-
import org.junit.Test
20-
import java.util.*
19+
import kotlinx.collections.immutable.internal.assert
20+
import kotlin.math.pow
2121
import kotlin.test.*
2222

2323
class TrieIteratorTest {
@@ -41,7 +41,7 @@ class TrieIteratorTest {
4141
val newLeaves = arrayListOf<Any?>()
4242
for (i in 0 until leaves.size step MAX_BUFFER_SIZE) {
4343
val buffer = arrayOfNulls<Any?>(MAX_BUFFER_SIZE)
44-
for (j in i until Math.min(leaves.size, i + MAX_BUFFER_SIZE)) {
44+
for (j in i until minOf(leaves.size, i + MAX_BUFFER_SIZE)) {
4545
buffer[j - i] = leaves[j]
4646
}
4747
newLeaves.add(buffer)
@@ -58,7 +58,7 @@ class TrieIteratorTest {
5858
var lastStop = 1
5959
for (height in 1..7) {
6060
for (leafCount in lastStop..(1 shl 12) step height) {
61-
if (Math.pow(MAX_BUFFER_SIZE.toDouble(), (height - 1).toDouble()) < leafCount) {
61+
if (MAX_BUFFER_SIZE.toDouble().pow(height - 1) < leafCount) {
6262
lastStop = leafCount
6363
break
6464
}

0 commit comments

Comments
 (0)