summaryrefslogtreecommitdiff
path: root/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy')
-rw-r--r--java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy51
1 files changed, 51 insertions, 0 deletions
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
index 4e8961dbe192..0b12b544bbfd 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
@@ -52,6 +52,7 @@ import com.intellij.psi.PsiFile
import com.intellij.psi.PsiJavaFile
import com.intellij.psi.statistics.StatisticsManager
import com.intellij.psi.statistics.impl.StatisticsManagerImpl
+import com.intellij.testFramework.EditorTestUtil
import com.intellij.util.containers.ContainerUtil
import org.jetbrains.annotations.NotNull
@@ -1141,6 +1142,56 @@ class Foo {{
}}'''
}
+ public void testMulticaret() {
+ doTestMulticaret """
+class Foo {{
+ <selection>t<caret></selection>x;
+ <selection>t<caret></selection>x;
+}}""", '\n', '''
+class Foo {{
+ toString()<caret>x;
+ toString()<caret>x;
+}}'''
+ }
+
+ public void testMulticaretTab() {
+ doTestMulticaret """
+class Foo {{
+ <selection>t<caret></selection>x;
+ <selection>t<caret></selection>x;
+}}""", '\t', '''
+class Foo {{
+ toString()<caret>;
+ toString()<caret>;
+}}'''
+ }
+
+ public void testMulticaretBackspace() {
+ doTestMulticaret """
+class Foo {{
+ <selection>t<caret></selection>;
+ <selection>t<caret></selection>;
+}}""", '\b\t', '''
+class Foo {{
+ toString()<caret>;
+ toString()<caret>;
+}}'''
+ }
+
+ private doTestMulticaret(final String textBefore, final String toType, final String textAfter) {
+ EditorTestUtil.enableMultipleCarets()
+ try {
+ myFixture.configureByText "a.java", textBefore
+ type 'toStr'
+ assert lookup
+ type toType
+ myFixture.checkResult textAfter
+ }
+ finally {
+ EditorTestUtil.disableMultipleCarets()
+ }
+ }
+
private doTestBlockSelection(final String textBefore, final String toType, final String textAfter) {
myFixture.configureByText "a.java", textBefore
edt {