Files
kotlin-fork/backend.native/tests/runtime/basic/hash0.kt
T
2017-10-20 18:25:05 +03:00

22 lines
539 B
Kotlin

package runtime.basic.hash0
import kotlin.test.*
@Test fun runTest() {
println(239.hashCode())
println((-1L).hashCode())
println('a'.hashCode())
println(1.0f.hashCode())
println(1.0.hashCode())
println(true.hashCode())
println(false.hashCode())
println(Any().hashCode() != Any().hashCode())
val a = CharArray(5)
a[0] = 'H'
a[1] = 'e'
a[2] = 'l'
a[3] = 'l'
a[4] = 'o'
// Note that it uses private Konan API.
println("Hello".hashCode() == fromCharArray(a, 0, 5).hashCode())
}