diff --git a/idea/testData/templates/fun0.exp.kt b/idea/testData/templates/fun0.exp.kt new file mode 100644 index 00000000000..9f0021f25c9 --- /dev/null +++ b/idea/testData/templates/fun0.exp.kt @@ -0,0 +1,3 @@ +fun foo() : Unit { + +} \ No newline at end of file diff --git a/idea/testData/templates/fun0.kt b/idea/testData/templates/fun0.kt new file mode 100644 index 00000000000..81389d50841 --- /dev/null +++ b/idea/testData/templates/fun0.kt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/idea/testData/templates/fun1.exp.kt b/idea/testData/templates/fun1.exp.kt new file mode 100644 index 00000000000..a6845e8fe7d --- /dev/null +++ b/idea/testData/templates/fun1.exp.kt @@ -0,0 +1,3 @@ +fun foo(x : Any) : Unit { + +} \ No newline at end of file diff --git a/idea/testData/templates/fun1.kt b/idea/testData/templates/fun1.kt new file mode 100644 index 00000000000..81389d50841 --- /dev/null +++ b/idea/testData/templates/fun1.kt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/idea/testData/templates/fun2.exp.kt b/idea/testData/templates/fun2.exp.kt new file mode 100644 index 00000000000..4a49344a3e4 --- /dev/null +++ b/idea/testData/templates/fun2.exp.kt @@ -0,0 +1,3 @@ +fun foo(x : Any, y : Any) : Unit { + +} \ No newline at end of file diff --git a/idea/testData/templates/fun2.kt b/idea/testData/templates/fun2.kt new file mode 100644 index 00000000000..81389d50841 --- /dev/null +++ b/idea/testData/templates/fun2.kt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/LiveTemplatesTest.java b/idea/tests/org/jetbrains/jet/plugin/codeInsight/LiveTemplatesTest.java index 53d0f32b79c..879d56a5935 100644 --- a/idea/tests/org/jetbrains/jet/plugin/codeInsight/LiveTemplatesTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/LiveTemplatesTest.java @@ -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()); }