From c895f502f93b05f52495f41764e01ff6e438d110 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Mon, 13 Feb 2012 21:38:33 +0400 Subject: [PATCH] Added test for closure template. --- idea/testData/templates/closure.exp.kt | 3 +++ idea/testData/templates/closure.kt | 3 +++ .../jet/plugin/codeInsight/LiveTemplatesTest.java | 13 +++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 idea/testData/templates/closure.exp.kt create mode 100644 idea/testData/templates/closure.kt 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); }