Added tests for interface and singleton.

This commit is contained in:
Evgeny Gerashchenko
2012-02-13 21:39:48 +04:00
parent c895f502f9
commit 1c8ca38380
5 changed files with 34 additions and 10 deletions
+3
View File
@@ -0,0 +1,3 @@
trait SomeTrait {
<caret>
}
+1
View File
@@ -0,0 +1 @@
<caret>
+3
View File
@@ -0,0 +1,3 @@
object MySingleton {
<caret>
}
+1
View File
@@ -0,0 +1 @@
<caret>
@@ -42,7 +42,7 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
start(); start();
assertStringItems("args", "x", "y"); assertStringItems("args", "x", "y");
typeAndNext("y"); typeAndNextTab("y");
checkAfter(); checkAfter();
} }
@@ -81,9 +81,9 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
public void testExfun() { public void testExfun() {
start(); start();
typeAndNext("Int"); typeAndNextTab("Int");
typeAndNext("foo"); typeAndNextTab("foo");
typeAndNext("arg : Int"); typeAndNextTab("arg : Int");
nextTab(); nextTab();
checkAfter(); checkAfter();
@@ -92,9 +92,9 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
public void testExval() { public void testExval() {
start(); start();
typeAndNext("Int"); typeAndNextTab("Int");
nextTab(); nextTab();
typeAndNext("Int"); typeAndNextTab("Int");
checkAfter(); checkAfter();
} }
@@ -102,9 +102,9 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
public void testExvar() { public void testExvar() {
start(); start();
typeAndNext("Int"); typeAndNextTab("Int");
nextTab(); nextTab();
typeAndNext("Int"); typeAndNextTab("Int");
checkAfter(); checkAfter();
} }
@@ -112,12 +112,28 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
public void testClosure() { public void testClosure() {
start(); start();
typeAndNext("param"); typeAndNextTab("param");
nextTab(); nextTab();
checkAfter(); checkAfter();
} }
public void testInterface() {
start();
typeAndNextTab("SomeTrait");
checkAfter();
}
public void testSingleton() {
start();
typeAndNextTab("MySingleton");
checkAfter();
}
public void testIter() { public void testIter() {
start(); start();
@@ -148,7 +164,7 @@ public class LiveTemplatesTest extends LightCodeInsightFixtureTestCase {
myFixture.checkResultByFile(getTestName(true) + ".exp.kt"); myFixture.checkResultByFile(getTestName(true) + ".exp.kt");
} }
private void typeAndNext(String s) { private void typeAndNextTab(String s) {
type(s); type(s);
nextTab(); nextTab();
} }