1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-03-01 22:46:01 +01:00

Macro recording test

This commit is contained in:
Andrey Vlasovskikh 2012-10-23 20:16:06 +04:00
parent c502c4a083
commit 6e8d3abb17

View File

@ -0,0 +1,27 @@
package org.jetbrains.plugins.ideavim.action;
import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.command.CommandState;
import com.maddyhome.idea.vim.common.Register;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.group.RegisterGroup;
import com.maddyhome.idea.vim.helper.StringHelper;
import org.jetbrains.plugins.ideavim.VimTestCase;
import javax.swing.*;
import java.util.List;
/**
* @author vlan
*/
public class MacroActionTest extends VimTestCase {
public void testRecordMacro() {
final List<KeyStroke> keyStrokes = StringHelper.stringToKeys("qa3lq");
final Editor editor = typeTextInFile(keyStrokes, "on<caret>e two three\n");
final CommandState commandState = CommandState.getInstance(editor);
assertFalse(commandState.isRecording());
final RegisterGroup registerGroup = CommandGroups.getInstance().getRegister();
final Register register = registerGroup.getRegister('a');
assertEquals("3l", register.getText());
}
}