Added test for closure template.

This commit is contained in:
Evgeny Gerashchenko
2012-02-13 21:38:33 +04:00
parent 1bd56b7121
commit c895f502f9
3 changed files with 17 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
fun main(args : Array<String>) {
val someFun = {param -> param}<caret>
}
+3
View File
@@ -0,0 +1,3 @@
fun main(args : Array<String>) {
val someFun = <caret>
}
@@ -109,9 +109,13 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
checkAfter(); checkAfter();
} }
private void typeAndNext(String s) { public void testClosure() {
type(s); start();
typeAndNext("param");
nextTab(); nextTab();
checkAfter();
} }
public void testIter() { public void testIter() {
@@ -144,6 +148,11 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
myFixture.checkResultByFile(getTestName(true) + ".exp.kt"); myFixture.checkResultByFile(getTestName(true) + ".exp.kt");
} }
private void typeAndNext(String s) {
type(s);
nextTab();
}
private void type(String s) { private void type(String s) {
myFixture.type(s); myFixture.type(s);
} }