diff --git a/java/java-tests/testData/codeInsight/completion/customFileType/1.cs b/java/java-tests/testData/codeInsight/completion/customFileType/1.cs new file mode 100644 index 000000000000..0b4823df9fb8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/customFileType/1.cs @@ -0,0 +1 @@ +cont \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/customFileType/1_after.cs b/java/java-tests/testData/codeInsight/completion/customFileType/1_after.cs new file mode 100644 index 000000000000..394c78d8c9cc --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/customFileType/1_after.cs @@ -0,0 +1 @@ +continue \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/customFileType/2.cs b/java/java-tests/testData/codeInsight/completion/customFileType/2.cs new file mode 100644 index 000000000000..70aba74d0d14 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/customFileType/2.cs @@ -0,0 +1,3 @@ +if (true) { + whi +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/customFileType/2_after.cs b/java/java-tests/testData/codeInsight/completion/customFileType/2_after.cs new file mode 100644 index 000000000000..84162300c95f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/customFileType/2_after.cs @@ -0,0 +1,3 @@ +if (true) { + while +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/customFileType/Erlang.erl b/java/java-tests/testData/codeInsight/completion/customFileType/Erlang.erl new file mode 100644 index 000000000000..427ce174b919 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/customFileType/Erlang.erl @@ -0,0 +1 @@ +ca diff --git a/java/java-tests/testData/codeInsight/completion/customFileType/WordCompletion.cs b/java/java-tests/testData/codeInsight/completion/customFileType/WordCompletion.cs new file mode 100644 index 000000000000..c60df17f6c7f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/customFileType/WordCompletion.cs @@ -0,0 +1,2 @@ +whiwhiwhi + whi diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/CustomFileTypeCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/CustomFileTypeCompletionTest.java new file mode 100644 index 000000000000..384f491b7e65 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/CustomFileTypeCompletionTest.java @@ -0,0 +1,37 @@ +package com.intellij.codeInsight.completion; + +import com.intellij.JavaTestUtil; + +/** + * Created by IntelliJ IDEA. + * User: Maxim.Mossienko + * Date: Oct 14, 2004 + * Time: 4:39:37 PM + * To change this template use File | Settings | File Templates. + */ +public class CustomFileTypeCompletionTest extends LightCompletionTestCase { + private static final String BASE_PATH = "/codeInsight/completion/customFileType/"; + + @Override + protected String getTestDataPath() { + return JavaTestUtil.getJavaTestDataPath(); + } + + public void testKeyWordCompletion() throws Exception { + configureByFile(BASE_PATH + "1.cs"); + checkResultByFile(BASE_PATH + "1_after.cs"); + + configureByFile(BASE_PATH + "2.cs"); + checkResultByFile(BASE_PATH + "2_after.cs"); + } + + public void testWordCompletion() throws Throwable { + configureByFile(BASE_PATH + "WordCompletion.cs"); + testByCount(2, "while", "whiwhiwhi"); + } + + public void testErlang() throws Throwable { + configureByFile(BASE_PATH + "Erlang.erl"); + testByCount(2, "case", "catch"); + } +}