mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-229351 Undo doesn't work for "copy file" action
GitOrigin-RevId: 99b2657aac81bff23564daf37954fe88e448ce1e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
612c0aab2a
commit
49c6d25e68
@@ -22,6 +22,7 @@ import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.TestDialog;
|
||||
import com.intellij.openapi.util.EmptyRunnable;
|
||||
import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
@@ -125,6 +126,20 @@ public class GlobalUndoTest extends UndoTestCase implements TestDialog {
|
||||
checkAllFilesDeleted();
|
||||
}
|
||||
|
||||
public void testUndoFileCopy() throws Exception {
|
||||
VirtualFile file = createFile("a.txt", "").getVirtualFile();
|
||||
|
||||
VirtualFile dir = file.getParent();
|
||||
VirtualFile copy = WriteCommandAction.runWriteCommandAction(myProject, (ThrowableComputable<VirtualFile, IOException>)() -> {
|
||||
return file.copy(this, dir, "b.txt");
|
||||
});
|
||||
|
||||
globalUndo();
|
||||
|
||||
assertTrue(file.isValid());
|
||||
assertFalse(copy.isValid());
|
||||
}
|
||||
|
||||
public void testUndoRenameClass() {
|
||||
String firstClassName = "Class1";
|
||||
String secondClassName = "Class223467234678234678236478263478";
|
||||
|
||||
Reference in New Issue
Block a user