JS: add test to prove that anonymous function that declares lambda is translated correctly. See KT-11589

This commit is contained in:
Alexey Andreev
2016-12-14 15:53:18 +03:00
parent c82f8213b0
commit 91aeeb20e8
2 changed files with 13 additions and 0 deletions
@@ -2233,6 +2233,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/expression/function"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.JS, true);
}
@TestMetadata("anonymousWithLambda.kt")
public void testAnonymousWithLambda() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/expression/function/anonymousWithLambda.kt");
doTest(fileName);
}
@TestMetadata("callFunInInit.kt")
public void testCallFunInInit() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/expression/function/callFunInInit.kt");
@@ -0,0 +1,7 @@
fun box(): String {
val a = (fun(): String {
val o = { "O" }
return o() + "K"
})
return a()
}