Generate codegen tests on scripts

This commit is contained in:
Alexander Udalov
2014-08-11 14:31:30 +04:00
parent 6b6133be41
commit 9ae95c1e5c
9 changed files with 230 additions and 177 deletions
@@ -0,0 +1,8 @@
// this script expects parameter num : Int
fun fib(n: Int): Int {
val v = if(n < 2) 1 else fib(n-1) + fib(n-2)
return v
}
val result = fib(num)
@@ -0,0 +1,11 @@
package test
// this script expected parameter num : Int
fun fib(n: Int): Int {
val v = if(n < 2) 1 else fib(n-1) + fib(n-2)
return v
}
val result: Int = fib(num)
12
@@ -0,0 +1,4 @@
val fibwp = test.Fibwp(5)
val callResult = fibwp.fib(4)
val result = fibwp.num + fibwp.result - 5
fibwp.rv
@@ -0,0 +1,2 @@
val v = 239
fun method() = num + v