mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
added test for IDEA-111701 (2 editors for 1 document)
This commit is contained in:
+20
@@ -15,6 +15,9 @@
|
||||
*/
|
||||
package com.intellij.openapi.editor.actions;
|
||||
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.impl.CaretModelImpl;
|
||||
import com.intellij.openapi.editor.impl.EditorImpl;
|
||||
import com.intellij.openapi.ide.CopyPasteManager;
|
||||
import com.intellij.openapi.ide.KillRingTransferable;
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
|
||||
@@ -121,4 +124,21 @@ public class KillToWordEndActionTest extends LightPlatformCodeInsightTestCase {
|
||||
Object string = contents.getTransferData(DataFlavor.stringFlavor);
|
||||
assertEquals("first second", string);
|
||||
}
|
||||
|
||||
public void testDoubleEditors() throws Exception {
|
||||
String text = "<caret>first second third";
|
||||
configureFromFileText(getTestName(false) + ".txt", text);
|
||||
final Document document = myEditor.getDocument();
|
||||
final CaretModelImpl caretModel = new CaretModelImpl((EditorImpl)myEditor);
|
||||
document.addDocumentListener(caretModel);
|
||||
caretModel.moveToOffset(document.getTextLength()-1);
|
||||
killToWordEnd();
|
||||
killToWordEnd();
|
||||
checkResultByText(" third");
|
||||
|
||||
Transferable contents = CopyPasteManager.getInstance().getContents();
|
||||
assertTrue(contents instanceof KillRingTransferable);
|
||||
Object string = contents.getTransferData(DataFlavor.stringFlavor);
|
||||
assertEquals("first second", string);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user