[K/N][Tests] Move codegen test sources cycles..innerClass

^KT-61259
This commit is contained in:
Vladimir Sukharev
2023-12-13 23:53:55 +01:00
committed by Space Team
parent 35d2be25b2
commit 71a834b778
282 changed files with 2376 additions and 756 deletions
+27
View File
@@ -0,0 +1,27 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
package codegen.function.sum
import kotlin.test.*
fun sumIB(a:Int, b:Byte ) = a + b
fun sumIS(a:Int, b:Short ) = a + b
fun sumII(a:Int, b:Int ) = a + b
fun sumIL(a:Int, b:Long ) = a + b
fun sumIF(a:Int, b:Float ) = a + b
fun sumID(a:Int, b:Double) = a + b
fun modID(a:Int, b:Double) = a % b
@Test fun runTest() {
if (sumIB(2, 3) != 5) throw Error()
if (sumIS(2, 3) != 5) throw Error()
if (sumII(2, 3) != 5) throw Error()
if (sumIL(2, 3L) != 5L) throw Error()
if (sumIF(2, 3.0f) != 5.0f) throw Error()
if (sumID(2, 3.0) != 5.0) throw Error()
if (modID(5, 3.0) != 2.0) throw Error()
}