BC native tests port to Konan's TestRunner
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package codegen.function.arithmetic
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
fun square(a:Int):Int = a * a
|
||||
fun sumOfSquares(a:Int, b:Int):Int = square(a) + square(b)
|
||||
fun diffOfSquares(a:Int, b:Int):Int = square(a) - square(b)
|
||||
fun mod(a:Int,b:Int):Int = a / b
|
||||
fun remainder(a:Int, b:Int):Int = a % b
|
||||
|
||||
fun main(args:Array<String>) {
|
||||
@Test fun runTest() {
|
||||
if (square(2) != 4) throw Error()
|
||||
if (sumOfSquares(2, 4) != 20) throw Error()
|
||||
if (diffOfSquares(2, 4) != -12) throw Error()
|
||||
|
||||
Reference in New Issue
Block a user