mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-05-04 07:34:03 +02:00
Add some tests for one time mode
This commit is contained in:
parent
568d5ca4ff
commit
336efa1e8b
annotation-processors/src/main/kotlin/com/intellij/vim/annotations
src/test/java/org/jetbrains/plugins/ideavim/action/change/insert
@ -44,7 +44,7 @@ enum class Mode(val abbrev: Char) {
|
||||
OP_PENDING('O'),
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Insert mode
|
||||
* Indicates this key mapping applies to Insert or Replace modes
|
||||
*/
|
||||
INSERT('I'),
|
||||
|
||||
|
@ -12,14 +12,38 @@ import com.maddyhome.idea.vim.state.mode.Mode
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class InsertSingleCommandActionTest : VimTestCase() {
|
||||
class InsertSingleCommandActionTest : SingleCommandActionTest() {
|
||||
override val command: String = "i"
|
||||
override val mode: Mode = Mode.INSERT
|
||||
}
|
||||
|
||||
class ReplaceSingleCommandActionTest : SingleCommandActionTest() {
|
||||
override val command: String = "R"
|
||||
override val mode: Mode = Mode.REPLACE
|
||||
}
|
||||
|
||||
abstract class SingleCommandActionTest : VimTestCase() {
|
||||
|
||||
abstract val command: String
|
||||
abstract val mode: Mode
|
||||
|
||||
@Test
|
||||
fun `one operation`() {
|
||||
doTest(
|
||||
listOf(command, "<C-O>", "l"),
|
||||
"I found ${c}it in a legendary land",
|
||||
"I found i${c}t in a legendary land",
|
||||
mode,
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test enter visual`() {
|
||||
doTest(
|
||||
listOf("i", "<C-O>", "vlll", "<Esc>"),
|
||||
listOf(command, "<C-O>", "vlll", "<Esc>"),
|
||||
"I found ${c}it in a legendary land",
|
||||
"I found it ${c}in a legendary land",
|
||||
Mode.INSERT,
|
||||
mode,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user