ScriptGenTest: more
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
val x: Int
|
||||
|
||||
if (true) {
|
||||
fun foo(y: Int) = y + 20
|
||||
x = foo(9)
|
||||
}
|
||||
|
||||
x
|
||||
|
||||
// expected: 29
|
||||
@@ -0,0 +1,11 @@
|
||||
val z = 30
|
||||
val x: Int
|
||||
|
||||
if (true) {
|
||||
fun foo() = z + 20
|
||||
x = foo()
|
||||
}
|
||||
|
||||
x
|
||||
|
||||
// expected: 50
|
||||
@@ -46,6 +46,14 @@ public class ScriptGenTest extends CodegenTestCase {
|
||||
blackBoxFile("script/topLevelFunctionClosure.ktscript");
|
||||
}
|
||||
|
||||
public void testSecondLevelFunction() {
|
||||
blackBoxFile("script/secondLevelFunction.ktscript");
|
||||
}
|
||||
|
||||
public void testSecondLevelFunctionClosure() {
|
||||
blackBoxFile("script/secondLevelFunctionClosure.ktscript");
|
||||
}
|
||||
|
||||
public void testScriptParameter() {
|
||||
blackBoxFile("script/parameter.ktscript");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user