92e666f023
The function was disabled due to an issue with catch serialization. Now the issue is fixed and the function can be re-enabled.
22 lines
681 B
Kotlin
22 lines
681 B
Kotlin
package kotlin.test
|
|
|
|
@Suppress("UNUSED_PARAMETER")
|
|
public fun assertTypeEquals(expected: Any?, actual: Any?) {
|
|
//TODO: find analogue
|
|
//assertEquals(expected?.javaClass, actual?.javaClass)
|
|
}
|
|
|
|
fun <T> Iterable<T>.assertSorted(isInOrder: (T, T) -> Boolean): Unit { this.iterator().assertSorted(isInOrder) }
|
|
fun <T> Iterator<T>.assertSorted(isInOrder: (T, T) -> Boolean) {
|
|
if (!hasNext()) return
|
|
var index = 0
|
|
var prev = next()
|
|
while (hasNext()) {
|
|
index += 1
|
|
val next = next()
|
|
assertTrue(isInOrder(prev, next), "Not in order at position $index, element[${index-1}]: $prev, element[$index]: $next")
|
|
prev = next
|
|
}
|
|
return
|
|
}
|