Added tests for fun0, fun1, fun2.

This commit is contained in:
Evgeny Gerashchenko
2012-02-13 21:26:35 +04:00
parent db8fa0dd0a
commit bb06bcab6c
7 changed files with 46 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
fun foo() : Unit {
<caret>
}
+1
View File
@@ -0,0 +1 @@
<caret>
+3
View File
@@ -0,0 +1,3 @@
fun foo(x : Any) : Unit {
<caret>
}
+1
View File
@@ -0,0 +1 @@
<caret>
+3
View File
@@ -0,0 +1,3 @@
fun foo(x : Any, y : Any) : Unit {
<caret>
}
+1
View File
@@ -0,0 +1 @@
<caret>
@@ -52,13 +52,39 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
paremeterless();
}
public void testFun0() {
start();
type("foo");
nextTab(2);
checkAfter();
}
public void testFun1() {
start();
type("foo");
nextTab(4);
checkAfter();
}
public void testFun2() {
start();
type("foo");
nextTab(6);
checkAfter();
}
public void testIter() {
start();
assertStringItems("args", "collection", "myList", "str", "stream");
type("args");
nextTab();
nextTab();
nextTab(2);
checkAfter();
}
@@ -91,6 +117,12 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
getTemplateState().nextTab();
}
private void nextTab(int times) {
for (int i = 0; i < times; i++) {
nextTab();
}
}
private TemplateState getTemplateState() {
return TemplateManagerImpl.getTemplateState(myFixture.getEditor());
}