[K/N] Migrate some runtime/basic tests to new testing infra ^KT-61259

This commit is contained in:
Alexander Shabalin
2023-10-25 18:15:18 +02:00
committed by Space Team
parent 4fa121071a
commit fa9c620261
35 changed files with 448 additions and 636 deletions
@@ -0,0 +1,29 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package test.numbers
import kotlin.test.*
// Native-specific part of stdlib/test/numbers/ConversionTest.kt
class ConversionNativeTest {
@Test
fun floatToInt() {
fun testEquals(expected: Int, v: Float) = assertEquals(expected, v.toInt())
testEquals(3, 3.14f)
testEquals(-33333, -33333.12312f)
testEquals(-1, -1.2f)
testEquals(-12, -12.6f)
testEquals(2, 2.3f)
}
@Test
fun intToShort() {
fun testEquals(expected: Short, v: Int) = assertEquals(expected, v.toShort())
testEquals(-1, Int.MAX_VALUE)
}
}