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:
parent
c502c4a083
commit
6e8d3abb17
@ -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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user