diff --git a/idea/testData/templates/closure.exp.kt b/idea/testData/templates/closure.exp.kt new file mode 100644 index 00000000000..bf00def3787 --- /dev/null +++ b/idea/testData/templates/closure.exp.kt @@ -0,0 +1,3 @@ +fun main(args : Array) { + val someFun = {param -> param} +} diff --git a/idea/testData/templates/closure.kt b/idea/testData/templates/closure.kt new file mode 100644 index 00000000000..83464539e04 --- /dev/null +++ b/idea/testData/templates/closure.kt @@ -0,0 +1,3 @@ +fun main(args : Array) { + val someFun = +} diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/LiveTemplatesTest.java b/idea/tests/org/jetbrains/jet/plugin/codeInsight/LiveTemplatesTest.java index cd97e7680bb..3379270176c 100644 --- a/idea/tests/org/jetbrains/jet/plugin/codeInsight/LiveTemplatesTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/LiveTemplatesTest.java @@ -109,9 +109,13 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase { checkAfter(); } - private void typeAndNext(String s) { - type(s); + public void testClosure() { + start(); + + typeAndNext("param"); nextTab(); + + checkAfter(); } public void testIter() { @@ -144,6 +148,11 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase { myFixture.checkResultByFile(getTestName(true) + ".exp.kt"); } + private void typeAndNext(String s) { + type(s); + nextTab(); + } + private void type(String s) { myFixture.type(s); }