mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-03-10 12:32:19 +01:00
Add more tests for till character motions
This commit is contained in:
parent
16d9a3ba8b
commit
1f9718a3c1
test/org/jetbrains/plugins/ideavim/action
@ -134,12 +134,6 @@ public class MultipleCaretsTest extends VimTestCase {
|
||||
assertState("aaaba<caret>baba<caret>b<caret>b<caret>x");
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.MULTICARET)
|
||||
public void testMotionLastLeftTillMatchChar() {
|
||||
typeTextInFile(parseKeys("Ta,"), "b<caret>aba<caret>a<caret>a<caret>ba<caret>b");
|
||||
assertState("ba<caret>baa<caret>a<caret>ba<caret>b");
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.MULTICARET)
|
||||
public void testMotionLastRightTillMatchChar() {
|
||||
typeTextInFile(parseKeys("ta;"), "<caret>b<caret>a<caret>b<caret>a<caret>a<caret>a<caret>ba<caret>b");
|
||||
|
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2021 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
|
||||
import com.maddyhome.idea.vim.command.CommandState
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionLeftMatchCharActionTest : VimTestCase() {
|
||||
fun `test move and repeat`() {
|
||||
doTest("Fx;",
|
||||
"hello x hello x hello${c}",
|
||||
"hello ${c}x hello x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat twice`() {
|
||||
doTest("Fx;;",
|
||||
"hello x hello x hello x hello${c}",
|
||||
"hello ${c}x hello x hello x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat two`() {
|
||||
doTest("Fx2;",
|
||||
"hello x hello x hello x hello${c}",
|
||||
"hello ${c}x hello x hello x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat three`() {
|
||||
doTest("Fx3;",
|
||||
"hello x hello x hello x hello x hello${c}",
|
||||
"hello ${c}x hello x hello x hello x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2021 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
|
||||
import com.maddyhome.idea.vim.command.CommandState
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionRightMatchCharActionTest : VimTestCase() {
|
||||
fun `test move and repeat`() {
|
||||
doTest("fx;",
|
||||
"hello ${c}x hello x hello",
|
||||
"hello x hello ${c}x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat twice`() {
|
||||
doTest("fx;;",
|
||||
"${c}hello x hello x hello x hello",
|
||||
"hello x hello x hello ${c}x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat two`() {
|
||||
doTest("fx2;",
|
||||
"${c}hello x hello x hello x hello",
|
||||
"hello x hello x hello ${c}x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat three`() {
|
||||
doTest("fx3;",
|
||||
"${c}hello x hello x hello x hello x hello",
|
||||
"hello x hello x hello x hello ${c}x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2021 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
|
||||
import com.maddyhome.idea.vim.command.CommandState
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionRightTillMatchCharActionTest : VimTestCase() {
|
||||
fun `test move and repeat`() {
|
||||
doTest("tx;",
|
||||
"${c}hello x hello x hello",
|
||||
"hello x hello${c} x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat twice`() {
|
||||
doTest("tx;;",
|
||||
"${c}hello x hello x hello x hello",
|
||||
"hello x hello x hello${c} x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat two`() {
|
||||
doTest("tx2;",
|
||||
"${c}hello x hello x hello x hello",
|
||||
"hello x hello${c} x hello x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat three`() {
|
||||
doTest("tx3;",
|
||||
"${c}hello x hello x hello x hello x hello",
|
||||
"hello x hello x hello${c} x hello x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test move and repeat backwards`() {
|
||||
doTest("tx,",
|
||||
"hello x hello x ${c}hello x hello x hello",
|
||||
"hello x hello x${c} hello x hello x hello",
|
||||
CommandState.Mode.COMMAND,
|
||||
CommandState.SubMode.NONE)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user