mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-11 18:40:35 +02:00
Introduce new mechanizm for options testing
This commit is contained in:
parent
fd896c4af6
commit
edf9962abf
src/test/java/org/jetbrains/plugins/ideavim
NeovimTesting.ktRegisterActionsTest.ktTestHelper.ktVimOptionTestCase.ktVimTestCase.kt
action
ChangeNumberActionTest.ktMultipleCaretsTest.kt
change/delete
DeleteJoinLinesSpacesActionTest.ktDeleteJoinVisualLinesSpacesActionTest.ktDeleteVisualLinesEndActionTest.ktJoinNotificationTest.kt
copy
motion
leftright
MotionArrowLeftActionTest.ktMotionArrowRightActionTest.ktMotionEndActionTest.ktMotionHomeActionTest.ktMotionLeftActionTest.ktMotionRightActionTest.ktMotionShiftEndActionTest.ktMotionShiftHomeActionTest.ktMotionShiftLeftActionHandlerTest.ktMotionShiftRightActionHandlerTest.kt
mark
select/motion
updown
ex
extension/exchange
group
impl
vim-engine/src/main/kotlin/com/maddyhome/idea/vim/options
@ -30,7 +30,6 @@ import com.maddyhome.idea.vim.register.RegisterConstants.LAST_INSERTED_TEXT_REGI
|
||||
import com.maddyhome.idea.vim.register.RegisterConstants.LAST_SEARCH_REGISTER
|
||||
import com.maddyhome.idea.vim.register.RegisterConstants.VALID_REGISTERS
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInfo
|
||||
import org.junit.jupiter.params.provider.Arguments
|
||||
|
||||
@ -203,7 +202,6 @@ internal object NeovimTesting {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
annotation class TestWithoutNeovim(val reason: SkipNeovimReason, val description: String = "")
|
||||
|
||||
enum class SkipNeovimReason {
|
||||
@ -243,18 +241,3 @@ enum class SkipNeovimReason {
|
||||
fun LogicalPosition.toVimCoords(): VimCoords {
|
||||
return VimCoords(this.line + 1, this.column)
|
||||
}
|
||||
|
||||
fun <T, S, V> Collection<T>.cartesianProduct(other: Iterable<S>, transformer: (first: T, second: S) -> V): List<V> {
|
||||
return this.flatMap { first -> other.map { second -> transformer.invoke(first, second) } }
|
||||
}
|
||||
|
||||
// Cartesian product of multiple lists. Useful for making parameterized tests with all available combinations.
|
||||
// Can be used instead of @Theory from JUnit 4
|
||||
fun productForArguments(vararg elements: List<String>): List<Arguments> {
|
||||
val res = elements.fold(listOf<List<String>>(emptyList())) { acc, items ->
|
||||
acc.cartesianProduct(items) { accItems, item ->
|
||||
accItems + item
|
||||
}
|
||||
}
|
||||
return res.map { Arguments.of(*it.toArray(emptyArray())) }
|
||||
}
|
||||
|
@ -15,12 +15,18 @@ import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.handler.ActionBeanClass
|
||||
import com.maddyhome.idea.vim.key.CommandNode
|
||||
import com.maddyhome.idea.vim.key.CommandPartNode
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import javax.swing.KeyStroke
|
||||
import kotlin.test.assertNotNull
|
||||
|
||||
class RegisterActionsTest : VimTestCase() {
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.whichwrap, doesntAffectTest = true),
|
||||
)
|
||||
fun `test simple action`() {
|
||||
val before = "I ${c}found it in a legendary land"
|
||||
val after = "I f${c}ound it in a legendary land"
|
||||
@ -45,7 +51,10 @@ class RegisterActionsTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.whichwrap, doesntAffectTest = true),
|
||||
)
|
||||
fun `test turn plugin off and on`() {
|
||||
val before = "I ${c}found it in a legendary land"
|
||||
val after = "I f${c}ound it in a legendary land"
|
||||
@ -56,7 +65,10 @@ class RegisterActionsTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.whichwrap, doesntAffectTest = true),
|
||||
)
|
||||
fun `test enable twice`() {
|
||||
val before = "I ${c}found it in a legendary land"
|
||||
val after = "I f${c}ound it in a legendary land"
|
||||
@ -68,7 +80,10 @@ class RegisterActionsTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.whichwrap, doesntAffectTest = true),
|
||||
)
|
||||
fun `test unregister extension`() {
|
||||
val before = "I ${c}found it in a legendary land"
|
||||
val after = "I f${c}ound it in a legendary land"
|
||||
|
@ -13,16 +13,14 @@ import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.LogicalPosition
|
||||
import com.intellij.testFramework.EditorTestUtil
|
||||
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
|
||||
import com.maddyhome.idea.vim.api.getKnownToggleOption
|
||||
import com.intellij.util.containers.toArray
|
||||
import com.maddyhome.idea.vim.api.globalOptions
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.api.setToggleOption
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.common.TextRange
|
||||
import com.maddyhome.idea.vim.group.IjOptionConstants
|
||||
import com.maddyhome.idea.vim.helper.editorMode
|
||||
import com.maddyhome.idea.vim.options.OptionScope
|
||||
import javax.swing.KeyStroke
|
||||
import org.junit.jupiter.params.provider.Arguments
|
||||
import kotlin.test.fail
|
||||
|
||||
/**
|
||||
@ -112,38 +110,22 @@ fun waitCondition(
|
||||
return false
|
||||
}
|
||||
|
||||
internal const val c = EditorTestUtil.CARET_TAG
|
||||
internal const val s = EditorTestUtil.SELECTION_START_TAG
|
||||
internal const val se = EditorTestUtil.SELECTION_END_TAG
|
||||
internal fun <T, S, V> Collection<T>.cartesianProduct(other: Iterable<S>, transformer: (first: T, second: S) -> V): List<V> {
|
||||
return this.flatMap { first -> other.map { second -> transformer.invoke(first, second) } }
|
||||
}
|
||||
|
||||
internal fun enableExtensions(vararg extensionNames: String) {
|
||||
for (name in extensionNames) {
|
||||
injector.optionGroup.setToggleOption(injector.optionGroup.getKnownToggleOption(name), OptionScope.GLOBAL)
|
||||
// Cartesian product of multiple lists. Useful for making parameterized tests with all available combinations.
|
||||
// Can be used instead of @Theory from JUnit 4
|
||||
internal fun productForArguments(vararg elements: List<String>): List<Arguments> {
|
||||
val res = product(*elements)
|
||||
return res.map { Arguments.of(*it.toArray(emptyArray())) }
|
||||
}
|
||||
|
||||
internal fun <T> product(vararg elements: List<T>): List<List<T>> {
|
||||
val res = elements.fold(listOf<List<T>>(emptyList())) { acc, items ->
|
||||
acc.cartesianProduct(items) { accItems, item ->
|
||||
accItems + item
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
internal fun String.dotToTab(): String = replace('.', '\t')
|
||||
|
||||
internal fun String.dotToSpace(): String = replace('.', ' ')
|
||||
|
||||
internal fun commandToKeys(command: String): List<KeyStroke> {
|
||||
val keys: MutableList<KeyStroke> = ArrayList()
|
||||
if (!command.startsWith(":")) {
|
||||
keys.addAll(injector.parser.parseKeys(":"))
|
||||
}
|
||||
keys.addAll(injector.parser.stringToKeys(command)) // Avoids trying to parse 'command ... <args>' as a special char
|
||||
keys.addAll(injector.parser.parseKeys("<Enter>"))
|
||||
return keys
|
||||
}
|
||||
|
||||
internal fun exCommand(command: String) = ":$command<CR>"
|
||||
|
||||
internal fun searchToKeys(pattern: String, forwards: Boolean): List<KeyStroke> {
|
||||
val keys: MutableList<KeyStroke> = ArrayList()
|
||||
keys.addAll(injector.parser.parseKeys(if (forwards) "/" else "?"))
|
||||
keys.addAll(injector.parser.stringToKeys(pattern)) // Avoids trying to parse 'command ... <args>' as a special char
|
||||
keys.addAll(injector.parser.parseKeys("<CR>"))
|
||||
return keys
|
||||
}
|
||||
|
||||
internal fun searchCommand(pattern: String) = "$pattern<CR>"
|
||||
|
@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package org.jetbrains.plugins.ideavim
|
||||
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.ex.exExceptionMessage
|
||||
import com.maddyhome.idea.vim.options.OptionScope
|
||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimInt
|
||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.TestInfo
|
||||
|
||||
/**
|
||||
* @author Alex Plate
|
||||
*
|
||||
* This test case helps you to test IdeaVim options
|
||||
*
|
||||
* While inheriting from this class you should specify (via constructor), which options you are going to test.
|
||||
* After that each test method in this class should contains [VimOptionTestConfiguration] annotation with
|
||||
* description of which values of option should be set before starting test.
|
||||
*
|
||||
* e.g.
|
||||
* ```
|
||||
* @VimOptionTestConfiguration(VimTestOption("keymodel", LIST, ["startsel"]), VimTestOption("selectmode", LIST, ["key"]))
|
||||
* ```
|
||||
*
|
||||
* If you want to keep default configuration, you can put [VimOptionDefaultAll] annotation
|
||||
*/
|
||||
abstract class VimOptionTestCase(option: String, vararg otherOptions: String) : VimTestCase() {
|
||||
private val options: Set<String> = setOf(option, *otherOptions)
|
||||
|
||||
@BeforeEach
|
||||
override fun setUp(testInfo: TestInfo) {
|
||||
super.setUp(testInfo)
|
||||
val testMethod = this.testInfo.testMethod.get()
|
||||
if (!testMethod.isAnnotationPresent(VimOptionDefaultAll::class.java)) {
|
||||
if (!testMethod.isAnnotationPresent(VimOptionTestConfiguration::class.java)) kotlin.test.fail("You should add VimOptionTestConfiguration with options for this method")
|
||||
|
||||
val annotationValues = testMethod.getDeclaredAnnotation(VimOptionTestConfiguration::class.java) ?: run {
|
||||
kotlin.test.fail("You should have at least one VimOptionTestConfiguration annotation. Or you can use VimOptionDefaultAll")
|
||||
}
|
||||
val defaultOptions = testMethod.getDeclaredAnnotation(VimOptionDefault::class.java)?.values ?: emptyArray()
|
||||
|
||||
val annotationsValueList = annotationValues.value.map { it.optionName } + defaultOptions
|
||||
val annotationsValueSet = annotationsValueList.toSet()
|
||||
if (annotationsValueSet.size < annotationsValueList.size) kotlin.test.fail("You have duplicated options")
|
||||
if (annotationsValueSet != options) kotlin.test.fail("You should present all options in annotations")
|
||||
|
||||
annotationValues.value.forEach {
|
||||
val option = injector.optionGroup.getOption(it.optionName) ?: throw exExceptionMessage("E518", it.optionName)
|
||||
when (it.valueType) {
|
||||
OptionValueType.STRING -> injector.optionGroup.setOptionValue(option, OptionScope.GLOBAL, VimString(it.value))
|
||||
OptionValueType.NUMBER -> injector.optionGroup.setOptionValue(option, OptionScope.GLOBAL, VimInt(it.value))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class VimOptionDefaultAll
|
||||
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class VimOptionDefault(vararg val values: String)
|
||||
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class VimOptionTestConfiguration(vararg val value: VimTestOption)
|
||||
|
||||
@Target(AnnotationTarget.PROPERTY)
|
||||
annotation class VimTestOption(
|
||||
val optionName: String,
|
||||
val valueType: OptionValueType,
|
||||
val value: String,
|
||||
)
|
||||
|
||||
enum class OptionValueType {
|
||||
STRING,
|
||||
NUMBER,
|
||||
}
|
@ -324,8 +324,8 @@ abstract class VimTestCase {
|
||||
val bottomLogicalLine = fixture.editor.vim.visualLineToBufferLine(
|
||||
EditorHelper.getVisualLineAtBottomOfScreen(fixture.editor),
|
||||
)
|
||||
kotlin.test.assertTrue(bottomLogicalLine >= caretLogicalLine)
|
||||
kotlin.test.assertTrue(caretLogicalLine >= scrollToLogicalLine)
|
||||
assertTrue(bottomLogicalLine >= caretLogicalLine)
|
||||
assertTrue(caretLogicalLine >= scrollToLogicalLine)
|
||||
}
|
||||
|
||||
protected fun typeText(vararg keys: String) = typeText(keys.flatMap { injector.parser.parseKeys(it) })
|
||||
@ -405,7 +405,7 @@ abstract class VimTestCase {
|
||||
val carets = fixture.editor.caretModel.allCarets
|
||||
assertEquals(1, carets.size, "Wrong amount of carets")
|
||||
val actualPosition = carets[0].logicalPosition
|
||||
kotlin.test.assertEquals(LogicalPosition(line, column), actualPosition)
|
||||
assertEquals(LogicalPosition(line, column), actualPosition)
|
||||
NeovimTesting.assertCaret(fixture.editor, testInfo)
|
||||
}
|
||||
|
||||
@ -413,7 +413,7 @@ abstract class VimTestCase {
|
||||
val carets = fixture.editor.caretModel.allCarets
|
||||
assertEquals(1, carets.size, "Wrong amount of carets")
|
||||
val actualPosition = carets[0].visualPosition
|
||||
kotlin.test.assertEquals(VisualPosition(visualLine, visualColumn), actualPosition)
|
||||
assertEquals(VisualPosition(visualLine, visualColumn), actualPosition)
|
||||
}
|
||||
|
||||
fun assertOffset(vararg expectedOffsets: Int) {
|
||||
@ -427,7 +427,7 @@ abstract class VimTestCase {
|
||||
}
|
||||
assertEquals(expectedOffsets.size, carets.size, "Wrong amount of carets")
|
||||
for (i in expectedOffsets.indices) {
|
||||
kotlin.test.assertEquals(expectedOffsets[i], carets[i].offset)
|
||||
assertEquals(expectedOffsets[i], carets[i].offset)
|
||||
}
|
||||
|
||||
NeovimTesting.assertState(fixture.editor, testInfo)
|
||||
@ -470,11 +470,11 @@ abstract class VimTestCase {
|
||||
|
||||
val expected = ScreenBounds(leftLogicalColumn, rightLogicalColumn)
|
||||
val actual = ScreenBounds(actualLeftLogicalColumn, actualRightLogicalColumn)
|
||||
kotlin.test.assertEquals(expected, actual)
|
||||
assertEquals(expected, actual)
|
||||
}
|
||||
|
||||
fun assertLineCount(expected: Int) {
|
||||
kotlin.test.assertEquals(expected, fixture.editor.vim.lineCount())
|
||||
assertEquals(expected, fixture.editor.vim.lineCount())
|
||||
}
|
||||
|
||||
fun putMapping(modes: Set<MappingMode>, from: String, to: String, recursive: Boolean) {
|
||||
@ -490,14 +490,14 @@ abstract class VimTestCase {
|
||||
fun assertNoMapping(from: String) {
|
||||
val keys = injector.parser.parseKeys(from)
|
||||
for (mode in MappingMode.ALL) {
|
||||
kotlin.test.assertNull(VimPlugin.getKey().getKeyMapping(mode)[keys])
|
||||
assertNull(VimPlugin.getKey().getKeyMapping(mode)[keys])
|
||||
}
|
||||
}
|
||||
|
||||
fun assertNoMapping(from: String, modes: Set<MappingMode>) {
|
||||
val keys = injector.parser.parseKeys(from)
|
||||
for (mode in modes) {
|
||||
kotlin.test.assertNull(VimPlugin.getKey().getKeyMapping(mode)[keys])
|
||||
assertNull(VimPlugin.getKey().getKeyMapping(mode)[keys])
|
||||
}
|
||||
}
|
||||
|
||||
@ -508,7 +508,7 @@ abstract class VimTestCase {
|
||||
val info = VimPlugin.getKey().getKeyMapping(mode)[keys]
|
||||
assertNotNull<Any>(info)
|
||||
if (info is ToKeysMappingInfo) {
|
||||
kotlin.test.assertEquals(toKeys, info.toKeys)
|
||||
assertEquals(toKeys, info.toKeys)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -521,23 +521,23 @@ abstract class VimTestCase {
|
||||
|
||||
fun assertMode(expectedMode: VimStateMachine.Mode) {
|
||||
val mode = fixture.editor.editorMode
|
||||
kotlin.test.assertEquals(expectedMode, mode)
|
||||
assertEquals(expectedMode, mode)
|
||||
}
|
||||
|
||||
fun assertSubMode(expectedSubMode: SubMode) {
|
||||
val subMode = fixture.editor.subMode
|
||||
kotlin.test.assertEquals(expectedSubMode, subMode)
|
||||
assertEquals(expectedSubMode, subMode)
|
||||
}
|
||||
|
||||
fun assertSelection(expected: String?) {
|
||||
val selected = fixture.editor.selectionModel.selectedText
|
||||
kotlin.test.assertEquals(expected, selected)
|
||||
assertEquals(expected, selected)
|
||||
}
|
||||
|
||||
fun assertExOutput(expected: String) {
|
||||
val actual = getInstance(fixture.editor).text
|
||||
assertNotNull("No Ex output", actual)
|
||||
kotlin.test.assertEquals(expected, actual)
|
||||
assertEquals(expected, actual)
|
||||
NeovimTesting.typeCommand("<esc>", testInfo, fixture.editor)
|
||||
}
|
||||
|
||||
@ -547,7 +547,7 @@ abstract class VimTestCase {
|
||||
}
|
||||
|
||||
fun assertPluginError(isError: Boolean) {
|
||||
kotlin.test.assertEquals(isError, injector.messages.isError())
|
||||
assertEquals(isError, injector.messages.isError())
|
||||
}
|
||||
|
||||
fun assertPluginErrorMessageContains(message: String) {
|
||||
@ -563,21 +563,21 @@ abstract class VimTestCase {
|
||||
editor.caretModel.allCarets.forEach { caret ->
|
||||
// All carets should be the same except when in block sub mode, where we "hide" them (by drawing a zero width bar)
|
||||
if (caret !== editor.caretModel.primaryCaret && editor.inBlockSubMode) {
|
||||
kotlin.test.assertEquals(CaretVisualAttributes.Shape.BAR, caret.visualAttributes.shape)
|
||||
kotlin.test.assertEquals(0F, caret.visualAttributes.thickness)
|
||||
assertEquals(CaretVisualAttributes.Shape.BAR, caret.visualAttributes.shape)
|
||||
assertEquals(0F, caret.visualAttributes.thickness)
|
||||
} else {
|
||||
val shape = when (attributes.type) {
|
||||
GuiCursorType.BLOCK -> CaretVisualAttributes.Shape.BLOCK
|
||||
GuiCursorType.VER -> CaretVisualAttributes.Shape.BAR
|
||||
GuiCursorType.HOR -> CaretVisualAttributes.Shape.UNDERSCORE
|
||||
}
|
||||
kotlin.test.assertEquals(shape, editor.caretModel.primaryCaret.visualAttributes.shape)
|
||||
kotlin.test.assertEquals(
|
||||
assertEquals(shape, editor.caretModel.primaryCaret.visualAttributes.shape)
|
||||
assertEquals(
|
||||
attributes.thickness / 100.0F,
|
||||
editor.caretModel.primaryCaret.visualAttributes.thickness,
|
||||
)
|
||||
editor.caretModel.primaryCaret.visualAttributes.color?.let {
|
||||
kotlin.test.assertEquals(colour, it)
|
||||
assertEquals(colour, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -679,7 +679,7 @@ abstract class VimTestCase {
|
||||
val exception = assertThrows<ExException> {
|
||||
action()
|
||||
}
|
||||
kotlin.test.assertEquals(expectedErrorMessage, exception.message)
|
||||
assertEquals(expectedErrorMessage, exception.message)
|
||||
}
|
||||
|
||||
private fun typeTextViaIde(keys: List<KeyStroke?>, editor: Editor) {
|
||||
|
@ -9,6 +9,9 @@ package org.jetbrains.plugins.ideavim.action
|
||||
|
||||
import com.google.common.collect.Lists
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
@ -92,11 +95,11 @@ class ChangeNumberActionTest : VimTestCase() {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.nrformats, limitedValues = ["octal"]))
|
||||
fun testDecrementNegativeOctal() {
|
||||
// Minus isn't processed
|
||||
doTest(
|
||||
Lists.newArrayList(":set nf=octal<Enter>", "<C-X>"),
|
||||
Lists.newArrayList("<C-X>"),
|
||||
"-010",
|
||||
"-007",
|
||||
VimStateMachine.Mode.COMMAND,
|
||||
|
@ -2731,7 +2731,7 @@ rtyfg${c}hzxc"""
|
||||
typeText(injector.parser.parseKeys("ye"))
|
||||
val lastRegister = VimPlugin.getRegister().lastRegister
|
||||
assertNotNull<Any>(lastRegister)
|
||||
val text = lastRegister!!.text
|
||||
val text = lastRegister.text
|
||||
assertNotNull<Any>(text)
|
||||
typeText(injector.parser.parseKeys("P"))
|
||||
val after = "qwe as${c}dasd zx${c}czxc"
|
||||
@ -2753,7 +2753,7 @@ rtyfg${c}hzxc"""
|
||||
typeText(injector.parser.parseKeys("yj"))
|
||||
val lastRegister = VimPlugin.getRegister().lastRegister
|
||||
assertNotNull<Any>(lastRegister)
|
||||
val text = lastRegister!!.text
|
||||
val text = lastRegister.text
|
||||
assertNotNull<Any>(text)
|
||||
typeText(injector.parser.parseKeys("P"))
|
||||
val after = """
|
||||
@ -2787,7 +2787,7 @@ rtyfg${c}hzxc"""
|
||||
typeText(injector.parser.parseKeys("2yy"))
|
||||
val lastRegister = VimPlugin.getRegister().lastRegister
|
||||
assertNotNull<Any>(lastRegister)
|
||||
val text = lastRegister!!.text
|
||||
val text = lastRegister.text
|
||||
assertNotNull<Any>(text)
|
||||
typeText(injector.parser.parseKeys("j" + "p"))
|
||||
val after = """
|
||||
|
@ -10,17 +10,16 @@ package org.jetbrains.plugins.ideavim.action.change.delete
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.group.IjOptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class DeleteJoinLinesSpacesActionTest : VimOptionTestCase(IjOptionConstants.ideajoin) {
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideajoin, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
@TraceOptions
|
||||
class DeleteJoinLinesSpacesActionTest : VimTestCase() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideajoin))
|
||||
fun `test join with idea`() {
|
||||
doTest(
|
||||
"J",
|
||||
@ -44,8 +43,7 @@ class DeleteJoinLinesSpacesActionTest : VimOptionTestCase(IjOptionConstants.idea
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideajoin, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
@OptionTest(VimOption(IjOptionConstants.ideajoin))
|
||||
fun `test join with idea with count`() {
|
||||
doTest(
|
||||
"3J",
|
||||
@ -69,8 +67,7 @@ class DeleteJoinLinesSpacesActionTest : VimOptionTestCase(IjOptionConstants.idea
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideajoin, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
@OptionTest(VimOption(IjOptionConstants.ideajoin))
|
||||
fun `test join with idea with large count`() {
|
||||
doTest(
|
||||
"10J",
|
||||
|
@ -10,18 +10,17 @@ package org.jetbrains.plugins.ideavim.action.change.delete
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.group.IjOptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class DeleteJoinVisualLinesSpacesActionTest : VimOptionTestCase(IjOptionConstants.ideajoin) {
|
||||
@TraceOptions
|
||||
class DeleteJoinVisualLinesSpacesActionTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideajoin, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
@OptionTest(VimOption(IjOptionConstants.ideajoin, limitedValues = ["true"]))
|
||||
fun `test join via idea`() {
|
||||
doTest(
|
||||
"VjJ",
|
||||
|
@ -12,18 +12,16 @@ package org.jetbrains.plugins.ideavim.action.change.delete
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@TraceOptions(OptionConstants.virtualedit)
|
||||
class DeleteVisualLinesEndActionTest : VimTestCase() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion`() {
|
||||
val keys = listOf("v", "D")
|
||||
val before = """
|
||||
@ -45,8 +43,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]))
|
||||
fun `test virtual edit delete middle to end`() {
|
||||
doTest(
|
||||
"D",
|
||||
@ -64,8 +61,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]))
|
||||
fun `test virtual edit delete end to end`() {
|
||||
doTest(
|
||||
"D",
|
||||
@ -83,8 +79,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]))
|
||||
fun `test virtual edit delete to end from virtual space`() {
|
||||
doTest(
|
||||
"D",
|
||||
@ -101,8 +96,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion with indent`() {
|
||||
val keys = listOf("v", "D")
|
||||
val before = """
|
||||
@ -123,9 +117,8 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion with indent and nostartofline`() {
|
||||
val keys = listOf("v", "D")
|
||||
val before = """
|
||||
@ -148,8 +141,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
}
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion empty line`() {
|
||||
val keys = listOf("v", "D")
|
||||
val before = """
|
||||
@ -170,8 +162,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion last line`() {
|
||||
val keys = listOf("v", "D")
|
||||
val before = """
|
||||
@ -194,8 +185,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion first line`() {
|
||||
val keys = listOf("v", "D")
|
||||
val before = """
|
||||
@ -216,8 +206,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion before empty`() {
|
||||
val keys = listOf("v", "D")
|
||||
val before = """
|
||||
@ -240,8 +229,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion last line without empty line`() {
|
||||
val keys = listOf("v", "D")
|
||||
val before = """
|
||||
@ -262,8 +250,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion multiline`() {
|
||||
val keys = listOf("vj", "D")
|
||||
val before = """
|
||||
@ -283,8 +270,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test simple deletion multiline motion up`() {
|
||||
val keys = listOf("vk", "D")
|
||||
val before = """
|
||||
@ -304,9 +290,8 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test delete visual lines end action`() {
|
||||
typeTextInFile(
|
||||
"v" + "2j" + "D",
|
||||
@ -324,8 +309,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
assertState("${c}abcde\n${c}")
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test line simple deletion`() {
|
||||
val keys = listOf("V", "D")
|
||||
val before = """
|
||||
@ -346,8 +330,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test line deletion with indent`() {
|
||||
val keys = listOf("V", "D")
|
||||
val before = """
|
||||
@ -368,9 +351,8 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test line deletion with indent and nostartofline`() {
|
||||
val keys = listOf("V", "D")
|
||||
val before = """
|
||||
@ -393,8 +375,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
}
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test line deletion empty line`() {
|
||||
val keys = listOf("V", "D")
|
||||
val before = """
|
||||
@ -415,8 +396,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test line deletion last line`() {
|
||||
val keys = listOf("V", "D")
|
||||
val before = """
|
||||
@ -439,8 +419,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test line deletion last line without empty line`() {
|
||||
val keys = listOf("V", "D")
|
||||
val before = """
|
||||
@ -461,8 +440,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test line deletion multiline`() {
|
||||
val keys = listOf("Vj", "D")
|
||||
val before = """
|
||||
@ -482,8 +460,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test line deletion multiline motion up`() {
|
||||
val keys = listOf("Vk", "D")
|
||||
val before = """
|
||||
@ -503,9 +480,8 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test line delete visual lines end action`() {
|
||||
typeTextInFile(
|
||||
"V" + "2j" + "D",
|
||||
@ -523,8 +499,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
assertState("${c}abcde\n${c}")
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test block simple deletion`() {
|
||||
val keys = listOf("<C-V>", "D")
|
||||
val before = """
|
||||
@ -546,8 +521,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test block deletion empty line`() {
|
||||
val keys = listOf("<C-V>", "D")
|
||||
val before = """
|
||||
@ -569,8 +543,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test block deletion last line`() {
|
||||
val keys = listOf("<C-V>", "D")
|
||||
val before = """
|
||||
@ -594,8 +567,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test block deletion last line without empty line`() {
|
||||
val keys = listOf("<C-V>", "D")
|
||||
val before = """
|
||||
@ -617,8 +589,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test block deletion multiline`() {
|
||||
val keys = listOf("<C-V>j", "D")
|
||||
val before = """
|
||||
@ -640,8 +611,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test block deletion multiline motion up`() {
|
||||
val keys = listOf("<C-V>k", "D")
|
||||
val before = """
|
||||
@ -663,8 +633,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
doTest(keys, before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit))
|
||||
fun `test delete visual block line end action`() {
|
||||
typeTextInFile(
|
||||
"<C-V>" + "2j" + "2l" + "D",
|
||||
@ -690,9 +659,7 @@ class DeleteVisualLinesEndActionTest : VimOptionTestCase(OptionConstants.virtual
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore))
|
||||
@Test
|
||||
fun `test change dollar`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore])) fun `test change dollar`() {
|
||||
doTest(
|
||||
"c$",
|
||||
"""
|
||||
|
@ -16,18 +16,17 @@ import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.group.IjOptionConstants
|
||||
import com.maddyhome.idea.vim.group.NotificationService
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
/**
|
||||
* @author Alex Plate
|
||||
*/
|
||||
class JoinNotificationTest : VimOptionTestCase(IjOptionConstants.ideajoin) {
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideajoin, OptionValueType.NUMBER, "0"))
|
||||
@Test
|
||||
@TraceOptions(IjOptionConstants.ideajoin)
|
||||
class JoinNotificationTest : VimTestCase() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideajoin, limitedValues = ["false"]))
|
||||
fun `test notification shown for no ideajoin`() {
|
||||
val before = "I found${c} it\n in a legendary land"
|
||||
configureByText(before)
|
||||
@ -44,8 +43,7 @@ class JoinNotificationTest : VimOptionTestCase(IjOptionConstants.ideajoin) {
|
||||
}
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideajoin, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
@OptionTest(VimOption(IjOptionConstants.ideajoin, limitedValues = ["true"]))
|
||||
fun `test notification not shown for ideajoin`() {
|
||||
val before = "I found${c} it\n in a legendary land"
|
||||
configureByText(before)
|
||||
@ -56,8 +54,7 @@ class JoinNotificationTest : VimOptionTestCase(IjOptionConstants.ideajoin) {
|
||||
kotlin.test.assertTrue(notifications.isEmpty() || notifications.last().isExpired || IjOptionConstants.ideajoin !in notifications.last().content)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideajoin, OptionValueType.NUMBER, "0"))
|
||||
@Test
|
||||
@OptionTest(VimOption(IjOptionConstants.ideajoin, limitedValues = ["false"]))
|
||||
fun `test notification not shown if was shown already`() {
|
||||
val before = "I found${c} it\n in a legendary land"
|
||||
configureByText(before)
|
||||
|
@ -16,19 +16,15 @@ import com.maddyhome.idea.vim.command.SelectionType
|
||||
import com.maddyhome.idea.vim.group.NotificationService
|
||||
import com.maddyhome.idea.vim.newapi.vim
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.rangeOf
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
/**
|
||||
* @author Alex Plate
|
||||
*/
|
||||
class IdeaPutNotificationsTest : VimOptionTestCase(OptionConstants.clipboard) {
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@TraceOptions(OptionConstants.clipboard)
|
||||
class IdeaPutNotificationsTest : VimTestCase() {
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = [""]))
|
||||
fun `test notification exists if no ideaput`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
configureByText(before)
|
||||
@ -48,14 +44,7 @@ class IdeaPutNotificationsTest : VimOptionTestCase(OptionConstants.clipboard) {
|
||||
}
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.clipboard,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.clipboard_ideaput,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = [OptionConstants.clipboard_ideaput]))
|
||||
fun `test no notification on ideaput`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
configureByText(before)
|
||||
@ -69,8 +58,7 @@ class IdeaPutNotificationsTest : VimOptionTestCase(OptionConstants.clipboard) {
|
||||
kotlin.test.assertTrue(notifications.isEmpty() || notifications.last().isExpired || OptionConstants.clipboard_ideaput !in notifications.last().content)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = [""]))
|
||||
fun `test no notification if already was`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
configureByText(before)
|
||||
|
@ -10,17 +10,14 @@ package org.jetbrains.plugins.ideavim.action.copy
|
||||
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class YankAndPutTest : VimOptionTestCase(OptionConstants.clipboard) {
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, OptionConstants.clipboard_unnamed),
|
||||
)
|
||||
@Test
|
||||
@TraceOptions(OptionConstants.clipboard)
|
||||
class YankAndPutTest : VimTestCase() {
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = [OptionConstants.clipboard_unnamed]))
|
||||
fun `test yank to number register with unnamed`() {
|
||||
val before = """
|
||||
I ${c}found it in a legendary land
|
||||
@ -42,14 +39,7 @@ class YankAndPutTest : VimOptionTestCase(OptionConstants.clipboard) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.clipboard,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.clipboard_unnamed + "," + OptionConstants.clipboard_ideaput,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = [OptionConstants.clipboard_unnamed + "," + OptionConstants.clipboard_ideaput]))
|
||||
fun `test yank to number register with unnamed and ideaput`() {
|
||||
val before = """
|
||||
I ${c}found it in a legendary land
|
||||
@ -71,8 +61,7 @@ class YankAndPutTest : VimOptionTestCase(OptionConstants.clipboard) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = [""]))
|
||||
fun `test yank to number register`() {
|
||||
val before = """
|
||||
I ${c}found it in a legendary land
|
||||
|
@ -13,22 +13,20 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionArrowLeftActionTest : VimTestCase() {
|
||||
|
||||
// Kotlin type hints should be an obvious example of an inlay related to preceding text, but they are actually
|
||||
// related to following (KTIJ-3768). The inline rename options inlay is a better example
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to preceding text and block caret`() {
|
||||
val before = "I fou${c}nd it in a legendary land"
|
||||
val after = "I fo${c}und it in a legendary land"
|
||||
@ -52,8 +50,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to preceding text and block caret 2`() {
|
||||
val before = "I fo${c}und it in a legendary land"
|
||||
val after = "I f${c}ound it in a legendary land"
|
||||
@ -75,8 +72,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to preceding text and bar caret`() {
|
||||
val before = "I fou${c}nd it in a legendary land"
|
||||
val after = "I fo${c}und it in a legendary land"
|
||||
@ -104,8 +100,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to preceding text and bar caret 2`() {
|
||||
val before = "I fo${c}und it in a legendary land"
|
||||
val after = "I f${c}ound it in a legendary land"
|
||||
@ -132,8 +127,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
|
||||
// Kotlin parameter hints are a good example of inlays related to following text
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to following text with block caret`() {
|
||||
val before = "I fou${c}nd it in a legendary land"
|
||||
val after = "I fo${c}und it in a legendary land"
|
||||
@ -157,8 +151,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to following text with block caret 2`() {
|
||||
val before = "I fo${c}und it in a legendary land"
|
||||
val after = "I f${c}ound it in a legendary land"
|
||||
@ -180,8 +173,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to following text with bar caret`() {
|
||||
val before = "I fou${c}nd it in a legendary land"
|
||||
val after = "I fo${c}und it in a legendary land"
|
||||
@ -208,8 +200,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to following text with bar caret 2`() {
|
||||
val before = "I fo${c}und it in a legendary land"
|
||||
val after = "I f${c}ound it in a legendary land"
|
||||
@ -235,8 +226,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test visual default options`() {
|
||||
doTest(
|
||||
listOf("v", "<Left>"),
|
||||
@ -262,14 +252,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopsel,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopsel]))
|
||||
fun `test visual stopsel`() {
|
||||
doTest(
|
||||
listOf("v", "<Left>"),
|
||||
@ -295,14 +278,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test visual stopselect`() {
|
||||
doTest(
|
||||
listOf("v", "<Left>"),
|
||||
@ -328,14 +304,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual]))
|
||||
fun `test visual stopvisual`() {
|
||||
doTest(
|
||||
listOf("v", "<Left>"),
|
||||
@ -361,14 +330,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual]))
|
||||
fun `test visual stopvisual multicaret`() {
|
||||
doTest(
|
||||
listOf("v", "<Left>"),
|
||||
@ -394,8 +356,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test whichwrap in the same line`() {
|
||||
doTest(
|
||||
listOf("<Left>"),
|
||||
@ -411,8 +372,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test whichwrap at file start`() {
|
||||
doTest(
|
||||
listOf("<Left>"),
|
||||
@ -428,8 +388,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test whichwrap to previous line`() {
|
||||
doTest(
|
||||
listOf("<Left>"),
|
||||
@ -447,8 +406,7 @@ class MotionArrowLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test from empty line to empty line`() {
|
||||
doTest(
|
||||
listOf("<Left>"),
|
||||
|
@ -13,20 +13,18 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionArrowRightActionTest : VimTestCase() {
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to preceding text and block caret`() {
|
||||
val before = "I f${c}ound it in a legendary land"
|
||||
val after = "I fo${c}und it in a legendary land"
|
||||
@ -50,8 +48,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to preceding text and block caret 2`() {
|
||||
val before = "I fo${c}und it in a legendary land"
|
||||
val after = "I fou${c}nd it in a legendary land"
|
||||
@ -73,8 +70,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to preceding text and bar caret`() {
|
||||
val before = "I f${c}ound it in a legendary land"
|
||||
val after = "I fo${c}und it in a legendary land"
|
||||
@ -102,8 +98,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to preceding text and bar caret 2`() {
|
||||
val before = "I fo${c}und it in a legendary land"
|
||||
val after = "I fou${c}nd it in a legendary land"
|
||||
@ -139,8 +134,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
|
||||
// Kotlin parameter hints are a good example of inlays related to following text
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to following text and block caret`() {
|
||||
val before = "I f${c}ound it in a legendary land"
|
||||
val after = "I fo${c}und it in a legendary land"
|
||||
@ -163,8 +157,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.INLAYS)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test with inlay related to following text and bar caret`() {
|
||||
val before = "I f${c}ound it in a legendary land"
|
||||
val after = "I fo${c}und it in a legendary land"
|
||||
@ -191,8 +184,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test visual default options`() {
|
||||
doTest(
|
||||
listOf("v", "<Right>"),
|
||||
@ -218,14 +210,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopsel,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopsel]))
|
||||
fun `test visual stopsel`() {
|
||||
doTest(
|
||||
listOf("v", "<Right>"),
|
||||
@ -251,15 +236,8 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
fun `test visual stopselect`() {
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test visual stopselect`() {
|
||||
doTest(
|
||||
listOf("v", "<Right>"),
|
||||
"""
|
||||
@ -284,14 +262,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual]))
|
||||
fun `test visual stopvisual`() {
|
||||
doTest(
|
||||
listOf("v", "<Right>"),
|
||||
@ -317,14 +288,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual]))
|
||||
fun `test visual stopvisual multicaret`() {
|
||||
doTest(
|
||||
listOf("v", "<Right>"),
|
||||
@ -350,8 +314,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test whichwrap in the same line`() {
|
||||
doTest(
|
||||
listOf("<Right>"),
|
||||
@ -367,8 +330,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test whichwrap at file end`() {
|
||||
doTest(
|
||||
listOf("<Right>"),
|
||||
@ -384,8 +346,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test whichwrap to next line`() {
|
||||
doTest(
|
||||
listOf("<Right>"),
|
||||
@ -403,8 +364,7 @@ class MotionArrowRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test from empty line to empty line`() {
|
||||
doTest(
|
||||
listOf("<Right>"),
|
||||
|
@ -12,19 +12,17 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionEndActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionEndActionTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test motion end`() {
|
||||
val keys = listOf("<End>")
|
||||
val before = """
|
||||
@ -47,8 +45,7 @@ class MotionEndActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test continue visual`() {
|
||||
val keys = listOf("v", "<End>")
|
||||
val before = """
|
||||
@ -71,8 +68,7 @@ class MotionEndActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test continue select`() {
|
||||
val keys = listOf("gh", "<End>")
|
||||
val before = """
|
||||
@ -95,15 +91,7 @@ class MotionEndActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
fun `test exit visual`() {
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual])) fun `test exit visual`() {
|
||||
val keys = listOf("v", "<End>")
|
||||
val before = """
|
||||
A Discovery
|
||||
@ -125,14 +113,7 @@ class MotionEndActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test exit select`() {
|
||||
val keys = listOf("gh", "<End>")
|
||||
val before = """
|
||||
@ -154,9 +135,8 @@ class MotionEndActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test delete to the end`() {
|
||||
val keys = listOf("d", "<End>")
|
||||
val before = """
|
||||
|
@ -12,19 +12,17 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionHomeActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionHomeActionTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test motion home`() {
|
||||
val keys = "<Home>"
|
||||
val before = """
|
||||
@ -46,16 +44,14 @@ class MotionHomeActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test default stop select`() {
|
||||
val keymodel = optionsNoEditor().getStringListValues(OptionConstants.keymodel)
|
||||
kotlin.test.assertTrue(OptionConstants.keymodel_stopselect in keymodel)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test continue visual`() {
|
||||
val keys = listOf("v", "<Home>")
|
||||
val before = """
|
||||
@ -78,8 +74,7 @@ class MotionHomeActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test continue select`() {
|
||||
val keys = listOf("gh", "<Home>")
|
||||
val before = """
|
||||
@ -102,15 +97,7 @@ class MotionHomeActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
fun `test exit visual`() {
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual])) fun `test exit visual`() {
|
||||
val keys = listOf("v", "<Home>")
|
||||
val before = """
|
||||
A Discovery
|
||||
@ -132,14 +119,7 @@ class MotionHomeActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test exit select`() {
|
||||
val keys = listOf("gh", "<Home>")
|
||||
val before = """
|
||||
|
@ -10,7 +10,6 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
@ -32,7 +31,6 @@ class MotionLeftActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test whichwrap at file start`() {
|
||||
doTest(
|
||||
@ -49,7 +47,6 @@ class MotionLeftActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test whichwrap to previous line`() {
|
||||
doTest(
|
||||
@ -68,7 +65,6 @@ class MotionLeftActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test from empty line to empty line`() {
|
||||
doTest(
|
||||
@ -91,7 +87,6 @@ class MotionLeftActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test d command with whichwrap`() {
|
||||
doTest(
|
||||
|
@ -12,19 +12,17 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test simple motion`() {
|
||||
@TraceOptions(OptionConstants.virtualedit)
|
||||
class MotionRightActionTest : VimTestCase() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test simple motion`() {
|
||||
doTest(
|
||||
"l",
|
||||
"""
|
||||
@ -48,9 +46,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test simple motion with repeat`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test simple motion with repeat`() {
|
||||
doTest(
|
||||
"3l",
|
||||
"""
|
||||
@ -74,9 +71,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test simple motion to the end`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test simple motion to the end`() {
|
||||
doTest(
|
||||
"3l",
|
||||
"""
|
||||
@ -101,9 +97,7 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore))
|
||||
@Test
|
||||
fun `test virtual edit motion to the end`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore])) fun `test virtual edit motion to the end`() {
|
||||
doTest(
|
||||
"3l",
|
||||
"""
|
||||
@ -122,9 +116,7 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore))
|
||||
@Test
|
||||
fun `test virtual edit motion after dollar`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore])) fun `test virtual edit motion after dollar`() {
|
||||
doTest(
|
||||
"\$l",
|
||||
"""
|
||||
@ -143,9 +135,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.NON_ASCII)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test simple motion non-ascii`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test simple motion non-ascii`() {
|
||||
doTest(
|
||||
"l",
|
||||
"""
|
||||
@ -170,9 +161,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.NON_ASCII)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test simple motion emoji`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test simple motion emoji`() {
|
||||
doTest(
|
||||
"l",
|
||||
"""
|
||||
@ -197,9 +187,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.NON_ASCII)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test simple motion czech`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test simple motion czech`() {
|
||||
doTest(
|
||||
"l",
|
||||
"""
|
||||
@ -223,9 +212,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test simple motion tab`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test simple motion tab`() {
|
||||
doTest(
|
||||
"l",
|
||||
"""
|
||||
@ -249,9 +237,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test char visual mode`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test char visual mode`() {
|
||||
doTest(
|
||||
listOf("v", "ll"),
|
||||
"""
|
||||
@ -275,9 +262,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test block visual mode`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test block visual mode`() {
|
||||
doTest(
|
||||
listOf("<C-V>", "ll"),
|
||||
"""
|
||||
@ -302,9 +288,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test whichwrap in the same line`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test whichwrap in the same line`() {
|
||||
doTest(
|
||||
listOf("l"),
|
||||
"""
|
||||
@ -319,9 +304,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test whichwrap at file end`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test whichwrap at file end`() {
|
||||
doTest(
|
||||
listOf("l"),
|
||||
"""
|
||||
@ -336,9 +320,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test whichwrap to next line`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test whichwrap to next line`() {
|
||||
doTest(
|
||||
listOf("l"),
|
||||
"""
|
||||
@ -355,9 +338,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test from empty line to empty line`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test from empty line to empty line`() {
|
||||
doTest(
|
||||
listOf("l"),
|
||||
"""
|
||||
@ -378,9 +360,8 @@ class MotionRightActionTest : VimOptionTestCase(OptionConstants.virtualedit) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
fun `test d command with whichwrap`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, doesntAffectTest = true))
|
||||
fun `test d command with whichwrap`() {
|
||||
doTest(
|
||||
listOf("dl"),
|
||||
"""
|
||||
|
@ -13,19 +13,20 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
|
||||
class MotionShiftEndActionTest : VimOptionTestCase(OptionConstants.keymodel, OptionConstants.selectmode) {
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.selectmode)
|
||||
class MotionShiftEndActionTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.selectmode, doesntAffectTest = true),
|
||||
)
|
||||
fun `test simple end`() {
|
||||
val keys = listOf("<S-End>")
|
||||
val before = """
|
||||
@ -48,11 +49,10 @@ class MotionShiftEndActionTest : VimOptionTestCase(OptionConstants.keymodel, Opt
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test start visual`() {
|
||||
val keys = listOf("<S-End>")
|
||||
val before = """
|
||||
@ -75,11 +75,10 @@ class MotionShiftEndActionTest : VimOptionTestCase(OptionConstants.keymodel, Opt
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test start select`() {
|
||||
val keys = listOf("<S-End>")
|
||||
val before = """
|
||||
@ -101,12 +100,11 @@ class MotionShiftEndActionTest : VimOptionTestCase(OptionConstants.keymodel, Opt
|
||||
doTest(keys, before, after, VimStateMachine.Mode.SELECT, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test continue visual`() {
|
||||
val before = """
|
||||
A Discovery
|
||||
@ -132,12 +130,11 @@ class MotionShiftEndActionTest : VimOptionTestCase(OptionConstants.keymodel, Opt
|
||||
assertState(VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test continue select`() {
|
||||
val before = """
|
||||
A Discovery
|
||||
|
@ -13,19 +13,20 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionShiftHomeActionTest : VimOptionTestCase(OptionConstants.keymodel, OptionConstants.selectmode) {
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.selectmode)
|
||||
class MotionShiftHomeActionTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.selectmode, doesntAffectTest = true),
|
||||
)
|
||||
fun `test simple home`() {
|
||||
val keys = listOf("<S-Home>")
|
||||
val before = """
|
||||
@ -47,19 +48,20 @@ class MotionShiftHomeActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.selectmode, doesntAffectTest = true),
|
||||
)
|
||||
fun `test default continueselect`() {
|
||||
val keymodel = optionsNoEditor().getStringListValues(OptionConstants.keymodel)
|
||||
kotlin.test.assertTrue(OptionConstants.keymodel_continueselect in keymodel)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test start visual`() {
|
||||
val keys = listOf("<S-Home>")
|
||||
val before = """
|
||||
@ -82,11 +84,10 @@ class MotionShiftHomeActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test start select`() {
|
||||
val keys = listOf("<S-Home>")
|
||||
val before = """
|
||||
@ -108,12 +109,11 @@ class MotionShiftHomeActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
doTest(keys, before, after, VimStateMachine.Mode.SELECT, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test continue visual`() {
|
||||
val before = """
|
||||
A Discovery
|
||||
@ -139,12 +139,11 @@ class MotionShiftHomeActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
assertState(VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test continue select`() {
|
||||
val before = """
|
||||
A Discovery
|
||||
|
@ -12,22 +12,21 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymodel, OptionConstants.selectmode) {
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.selectmode)
|
||||
class MotionShiftLeftActionHandlerTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test visual left`() {
|
||||
fun `test visual left`() {
|
||||
doTest(
|
||||
listOf("<S-Left>"),
|
||||
"""
|
||||
@ -52,12 +51,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test visual left twice`() {
|
||||
fun `test visual left twice`() {
|
||||
doTest(
|
||||
listOf("<S-Left><S-Left>"),
|
||||
"""
|
||||
@ -82,12 +80,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test select left`() {
|
||||
fun `test select left`() {
|
||||
doTest(
|
||||
listOf("<S-Left>"),
|
||||
"""
|
||||
@ -112,12 +109,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test select left twice`() {
|
||||
fun `test select left twice`() {
|
||||
doTest(
|
||||
listOf("<S-Left><S-Left>"),
|
||||
"""
|
||||
@ -142,12 +138,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test simple motion char mode`() {
|
||||
fun `test simple motion char mode`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Left>"),
|
||||
"""
|
||||
@ -172,12 +167,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test double motion char mode`() {
|
||||
fun `test double motion char mode`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Left>".repeat(2)),
|
||||
"""
|
||||
@ -202,12 +196,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test at line start char mode`() {
|
||||
fun `test at line start char mode`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Left>".repeat(2)),
|
||||
"""
|
||||
@ -232,12 +225,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test at file start char mode`() {
|
||||
fun `test at file start char mode`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Left>".repeat(2)),
|
||||
"""
|
||||
@ -262,12 +254,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char mode multicaret`() {
|
||||
fun `test char mode multicaret`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Left>".repeat(2)),
|
||||
"""
|
||||
@ -292,12 +283,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test simple motion line mode`() {
|
||||
fun `test simple motion line mode`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Left>"),
|
||||
"""
|
||||
@ -322,12 +312,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test to line start line mode`() {
|
||||
fun `test to line start line mode`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Left>".repeat(5)),
|
||||
"""
|
||||
@ -352,12 +341,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test to file start line mode`() {
|
||||
fun `test to file start line mode`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Left>".repeat(5)),
|
||||
"""
|
||||
@ -382,12 +370,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line mode multicaret`() {
|
||||
fun `test line mode multicaret`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Left>".repeat(5)),
|
||||
"""
|
||||
@ -412,12 +399,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test simple motion block mode`() {
|
||||
fun `test simple motion block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Left>"),
|
||||
"""
|
||||
@ -442,12 +428,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test twice motion block mode`() {
|
||||
fun `test twice motion block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Left>".repeat(2)),
|
||||
"""
|
||||
@ -472,12 +457,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test at line start block mode`() {
|
||||
fun `test at line start block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Left>".repeat(2)),
|
||||
"""
|
||||
@ -502,12 +486,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test at file start block mode`() {
|
||||
fun `test at file start block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Left>".repeat(2)),
|
||||
"""
|
||||
@ -532,12 +515,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test multiline with empty line block mode`() {
|
||||
fun `test multiline with empty line block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Down>", "<S-Left>".repeat(2)),
|
||||
"""
|
||||
@ -563,12 +545,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test multiline block mode`() {
|
||||
fun `test multiline block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Down>".repeat(2), "<S-Left>".repeat(3)),
|
||||
"""
|
||||
@ -594,12 +575,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continuevisual),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continuevisual]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test continuevisual`() {
|
||||
fun `test continuevisual`() {
|
||||
doTest(
|
||||
listOf("v", "<S-Left>".repeat(3)),
|
||||
"""
|
||||
@ -624,12 +604,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test no continueselect`() {
|
||||
fun `test no continueselect`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Left>".repeat(3)),
|
||||
"""
|
||||
@ -654,12 +633,11 @@ class MotionShiftLeftActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test no continuevisual`() {
|
||||
fun `test no continuevisual`() {
|
||||
doTest(
|
||||
listOf("v", "<S-Left>".repeat(3)),
|
||||
"""
|
||||
|
@ -12,21 +12,20 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keymodel, OptionConstants.selectmode) {
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.selectmode)
|
||||
class MotionShiftRightActionHandlerTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test visual right`() {
|
||||
doTest(
|
||||
listOf("<S-Right>"),
|
||||
@ -52,11 +51,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test visual right twice`() {
|
||||
doTest(
|
||||
listOf("<S-Right><S-Right>"),
|
||||
@ -82,11 +80,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test select right`() {
|
||||
doTest(
|
||||
listOf("<S-Right>"),
|
||||
@ -112,11 +109,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test select right twice`() {
|
||||
doTest(
|
||||
listOf("<S-Right><S-Right>"),
|
||||
@ -142,11 +138,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test simple motion char mode`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Right>"),
|
||||
@ -172,11 +167,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test at the lineend char mode`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Right>"),
|
||||
@ -202,11 +196,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test out of line char mode`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Right>".repeat(2)),
|
||||
@ -232,11 +225,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test file end char mode`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Right>".repeat(2)),
|
||||
@ -262,11 +254,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test file char mode multicaret`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Right>".repeat(2)),
|
||||
@ -292,11 +283,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test simple motion line mode`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Right>"),
|
||||
@ -322,11 +312,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test lineend line mode`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Right>"),
|
||||
@ -352,11 +341,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test out of line line mode`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Right>".repeat(2)),
|
||||
@ -382,11 +370,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test fileend line mode`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Right>"),
|
||||
@ -412,11 +399,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line mode multicaret`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Right>"),
|
||||
@ -442,11 +428,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test simple motion block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Right>"),
|
||||
@ -472,11 +457,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test at the lineend block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Right>"),
|
||||
@ -502,11 +486,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test out of line block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Right>".repeat(2)),
|
||||
@ -532,11 +515,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test file end block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Right>".repeat(2)),
|
||||
@ -562,11 +544,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test to longer line block mode`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Down>", "<S-Right>".repeat(3)),
|
||||
@ -592,11 +573,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continuevisual),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continuevisual]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test continuevisual`() {
|
||||
doTest(
|
||||
listOf("v", "<S-Right>".repeat(3)),
|
||||
@ -622,11 +602,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test no continueselect`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Right>".repeat(3)),
|
||||
@ -652,11 +631,10 @@ class MotionShiftRightActionHandlerTest : VimOptionTestCase(OptionConstants.keym
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test no continuevisual`() {
|
||||
doTest(
|
||||
listOf("v", "<S-Right>".repeat(3)),
|
||||
|
@ -15,16 +15,14 @@ import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.group.IjOptionConstants
|
||||
import com.maddyhome.idea.vim.group.createLineBookmark
|
||||
import com.maddyhome.idea.vim.group.mnemonic
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionMarkActionTest : VimOptionTestCase(IjOptionConstants.ideamarks) {
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideamarks, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test simple add mark`() {
|
||||
@TraceOptions(IjOptionConstants.ideamarks)
|
||||
class MotionMarkActionTest : VimTestCase() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) fun `test simple add mark`() {
|
||||
val keys = injector.parser.parseKeys("mA")
|
||||
val text = """
|
||||
A Discovery
|
||||
@ -39,9 +37,7 @@ class MotionMarkActionTest : VimOptionTestCase(IjOptionConstants.ideamarks) {
|
||||
checkMarks('A' to 2)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideamarks, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test simple add multiple marks`() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) fun `test simple add multiple marks`() {
|
||||
val keys = injector.parser.parseKeys("mAj" + "mBj" + "mC")
|
||||
val text = """
|
||||
A Discovery
|
||||
@ -56,9 +52,7 @@ class MotionMarkActionTest : VimOptionTestCase(IjOptionConstants.ideamarks) {
|
||||
checkMarks('A' to 2, 'B' to 3, 'C' to 4)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideamarks, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test simple add multiple marks on same line`() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) fun `test simple add multiple marks on same line`() {
|
||||
val keys = injector.parser.parseKeys("mA" + "mB" + "mC")
|
||||
val text = """
|
||||
A Discovery
|
||||
@ -76,9 +70,7 @@ class MotionMarkActionTest : VimOptionTestCase(IjOptionConstants.ideamarks) {
|
||||
// checkMarks('A' to 2, 'B' to 2, 'C' to 2)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideamarks, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test move to another line`() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) fun `test move to another line`() {
|
||||
val keys = injector.parser.parseKeys("mAjj" + "mA")
|
||||
val text = """
|
||||
A Discovery
|
||||
@ -93,9 +85,7 @@ class MotionMarkActionTest : VimOptionTestCase(IjOptionConstants.ideamarks) {
|
||||
checkMarks('A' to 4)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideamarks, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test simple system mark`() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) fun `test simple system mark`() {
|
||||
val text = """
|
||||
A Discovery
|
||||
|
||||
@ -112,9 +102,7 @@ class MotionMarkActionTest : VimOptionTestCase(IjOptionConstants.ideamarks) {
|
||||
kotlin.test.assertEquals('A', vimMarks.first().key)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(IjOptionConstants.ideamarks, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test system mark move to another line`() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) fun `test system mark move to another line`() {
|
||||
val text = """
|
||||
A Discovery
|
||||
|
||||
|
@ -12,24 +12,22 @@ package org.jetbrains.plugins.ideavim.action.motion.select.motion
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class SelectMotionLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class SelectMotionLeftActionTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
@OptionTest(
|
||||
VimOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
limitedValues = [OptionConstants.keymodel_stopselect],
|
||||
),
|
||||
)
|
||||
@Test
|
||||
fun `test char select simple move`() {
|
||||
doTest(
|
||||
listOf("viw", "<C-G>", "<Left>"),
|
||||
@ -55,14 +53,7 @@ class SelectMotionLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test select multiple carets`() {
|
||||
doTest(
|
||||
listOf("viwo", "<C-G>", "<Left>"),
|
||||
@ -88,8 +79,7 @@ class SelectMotionLeftActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test without stopsel`() {
|
||||
doTest(
|
||||
listOf("viw", "<C-G>", "<Left>"),
|
||||
|
@ -12,24 +12,17 @@ package org.jetbrains.plugins.ideavim.action.motion.select.motion
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class SelectMotionRightActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class SelectMotionRightActionTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test char select simple move`() {
|
||||
doTest(
|
||||
listOf("viw", "<C-G>", "<Right>"),
|
||||
@ -55,14 +48,7 @@ class SelectMotionRightActionTest : VimOptionTestCase(OptionConstants.keymodel)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test select multiple carets`() {
|
||||
doTest(
|
||||
listOf("viw", "<C-G>", "<Right>"),
|
||||
@ -88,8 +74,7 @@ class SelectMotionRightActionTest : VimOptionTestCase(OptionConstants.keymodel)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test without stopsel`() {
|
||||
doTest(
|
||||
listOf("viw", "<C-G>", "<Right>"),
|
||||
|
@ -12,20 +12,20 @@ package org.jetbrains.plugins.ideavim.action.motion.updown
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefault
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, OptionConstants.virtualedit) {
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.virtualedit)
|
||||
class MotionArrowDownActionTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
)
|
||||
fun `test visual default options`() {
|
||||
doTest(
|
||||
listOf("v", "<Down>"),
|
||||
@ -51,15 +51,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopsel,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopsel]),
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
)
|
||||
@VimOptionDefault(OptionConstants.virtualedit)
|
||||
@Test
|
||||
fun `test visual stopsel`() {
|
||||
doTest(
|
||||
listOf("v", "<Down>"),
|
||||
@ -83,15 +78,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]),
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
)
|
||||
@VimOptionDefault(OptionConstants.virtualedit)
|
||||
@Test
|
||||
fun `test visual stopselect`() {
|
||||
doTest(
|
||||
listOf("v", "<Down>"),
|
||||
@ -117,15 +107,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual]),
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
)
|
||||
@VimOptionDefault(OptionConstants.virtualedit)
|
||||
@Test
|
||||
fun `test visual stopvisual`() {
|
||||
doTest(
|
||||
listOf("v", "<Down>"),
|
||||
@ -149,15 +134,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual]),
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
)
|
||||
@VimOptionDefault(OptionConstants.virtualedit)
|
||||
@Test
|
||||
fun `test visual stopvisual multicaret`() {
|
||||
doTest(
|
||||
listOf("v", "<Down>"),
|
||||
@ -181,9 +161,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""))
|
||||
@VimOptionDefault(OptionConstants.virtualedit)
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
)
|
||||
fun `test char select stopsel`() {
|
||||
doTest(
|
||||
listOf("gh", "<Down>"),
|
||||
@ -209,11 +190,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test virtual edit down to shorter line`() {
|
||||
doTest(
|
||||
listOf("<Down>"),
|
||||
@ -229,11 +209,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test virtual edit down to shorter line after dollar`() {
|
||||
doTest(
|
||||
listOf("$", "<Down>"),
|
||||
@ -258,11 +237,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
""".trimIndent()
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test up and down after dollar`() {
|
||||
// Arrow keys
|
||||
doTest(
|
||||
@ -278,11 +256,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test up and down after dollar1`() {
|
||||
doTest(
|
||||
listOf("$", "<Down>", "<Down>"),
|
||||
@ -297,11 +274,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test up and down after dollar2`() {
|
||||
doTest(
|
||||
listOf("$", "<Down>", "<Down>", "<Down>"),
|
||||
@ -316,11 +292,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test up and down after dollar3`() {
|
||||
doTest(
|
||||
listOf("$", "<Down>", "<Down>", "<Down>", "<Up>"),
|
||||
@ -335,11 +310,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test up and down after dollar4`() {
|
||||
// j k keys
|
||||
|
||||
@ -356,11 +330,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test up and down after dollar5`() {
|
||||
doTest(
|
||||
listOf("$", "j", "j"),
|
||||
@ -375,11 +348,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test up and down after dollar6`() {
|
||||
doTest(
|
||||
listOf("$", "j", "j", "j"),
|
||||
@ -394,11 +366,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""),
|
||||
VimTestOption(OptionConstants.virtualedit, OptionValueType.STRING, OptionConstants.virtualedit_onemore),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [""]),
|
||||
VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]),
|
||||
)
|
||||
@Test
|
||||
fun `test up and down after dollar7`() {
|
||||
doTest(
|
||||
listOf("$", "j", "j", "j", "k"),
|
||||
@ -413,15 +384,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]),
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
)
|
||||
@VimOptionDefault(OptionConstants.virtualedit)
|
||||
@Test
|
||||
fun `test char select simple move`() {
|
||||
doTest(
|
||||
listOf("gH", "<Down>"),
|
||||
@ -445,15 +411,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]),
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
)
|
||||
@VimOptionDefault(OptionConstants.virtualedit)
|
||||
@Test
|
||||
fun `test select multiple carets`() {
|
||||
doTest(
|
||||
listOf("gH", "<Down>"),
|
||||
@ -477,8 +438,10 @@ class MotionArrowDownActionTest : VimOptionTestCase(OptionConstants.keymodel, Op
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.virtualedit, doesntAffectTest = true),
|
||||
)
|
||||
fun `test arrow down in insert mode scrolls caret at scrolloff`() {
|
||||
configureByPages(5)
|
||||
enterCommand("set scrolljump=10")
|
||||
|
@ -12,19 +12,17 @@ package org.jetbrains.plugins.ideavim.action.motion.updown
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionArrowUpActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionArrowUpActionTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test visual default options`() {
|
||||
doTest(
|
||||
listOf("v", "<Up>"),
|
||||
@ -50,14 +48,7 @@ class MotionArrowUpActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopsel,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopsel]))
|
||||
fun `test visual stopsel`() {
|
||||
doTest(
|
||||
listOf("v", "<Up>"),
|
||||
@ -81,14 +72,7 @@ class MotionArrowUpActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test visual stopselect`() {
|
||||
doTest(
|
||||
listOf("v", "<Up>"),
|
||||
@ -114,14 +98,7 @@ class MotionArrowUpActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual]))
|
||||
fun `test visual stopvisual`() {
|
||||
doTest(
|
||||
listOf("v", "<Up>"),
|
||||
@ -145,14 +122,7 @@ class MotionArrowUpActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopvisual,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual]))
|
||||
fun `test visual stopvisual multicaret`() {
|
||||
doTest(
|
||||
listOf("v", "<Up>"),
|
||||
@ -176,14 +146,7 @@ class MotionArrowUpActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test char select simple move`() {
|
||||
doTest(
|
||||
listOf("gH", "<Up>"),
|
||||
@ -207,8 +170,7 @@ class MotionArrowUpActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, ""))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test char select stopsel`() {
|
||||
doTest(
|
||||
listOf("gh", "<Up>"),
|
||||
@ -234,14 +196,7 @@ class MotionArrowUpActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.keymodel,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.keymodel_stopselect,
|
||||
),
|
||||
)
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test select multiple carets`() {
|
||||
doTest(
|
||||
listOf("gH", "<Up>"),
|
||||
@ -265,8 +220,7 @@ class MotionArrowUpActionTest : VimOptionTestCase(OptionConstants.keymodel) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, doesntAffectTest = true))
|
||||
fun `test arrow up in insert mode scrolls caret at scrolloff`() {
|
||||
configureByPages(5)
|
||||
enterCommand("set scrolljump=10")
|
||||
|
@ -12,21 +12,20 @@ package org.jetbrains.plugins.ideavim.action.motion.updown
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymodel, OptionConstants.selectmode) {
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.selectmode)
|
||||
class MotionShiftDownActionHandlerTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test visual down`() {
|
||||
doTest(
|
||||
listOf("<S-Down>"),
|
||||
@ -52,11 +51,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test visual down twice`() {
|
||||
doTest(
|
||||
listOf("<S-Down><S-Down>"),
|
||||
@ -82,11 +80,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test save column`() {
|
||||
doTest(
|
||||
listOf("<S-Down><S-Down><S-Down>"),
|
||||
@ -112,11 +109,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test select down`() {
|
||||
doTest(
|
||||
listOf("<S-Down>"),
|
||||
@ -142,11 +138,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test select down twice`() {
|
||||
doTest(
|
||||
listOf("<S-Down><S-Down>"),
|
||||
@ -172,11 +167,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char select simple move`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Down>"),
|
||||
@ -202,11 +196,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char select move to empty line`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Down>"),
|
||||
@ -232,11 +225,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char select move from empty line`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Down>"),
|
||||
@ -262,11 +254,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char select move to file end`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Down>"),
|
||||
@ -292,11 +283,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char select move multicaret`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Down>"),
|
||||
@ -322,11 +312,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line select simple move`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Down>"),
|
||||
@ -352,11 +341,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line select to empty line`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Down>"),
|
||||
@ -382,11 +370,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line select from empty line`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Down>"),
|
||||
@ -412,11 +399,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line select to file end`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Down>"),
|
||||
@ -442,11 +428,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line select multicaret`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Down>"),
|
||||
@ -472,11 +457,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test block select simple move`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Down>"),
|
||||
@ -502,11 +486,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test block select to empty line`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Down>"),
|
||||
@ -532,11 +515,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test block select from empty line`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Down>"),
|
||||
@ -562,11 +544,10 @@ class MotionShiftDownActionHandlerTest : VimOptionTestCase(OptionConstants.keymo
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test block select to file end`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Down>"),
|
||||
|
@ -12,21 +12,20 @@ package org.jetbrains.plugins.ideavim.action.motion.updown
|
||||
|
||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectmode, OptionConstants.keymodel) {
|
||||
@TraceOptions(OptionConstants.selectmode, OptionConstants.keymodel)
|
||||
class MotionShiftUpActionHandlerTest : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test visual up`() {
|
||||
doTest(
|
||||
listOf("<S-Up>"),
|
||||
@ -52,11 +51,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test visual up twice`() {
|
||||
doTest(
|
||||
listOf("<S-Up><S-Up>"),
|
||||
@ -82,11 +80,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test save column`() {
|
||||
doTest(
|
||||
listOf("<S-Up><S-Up><S-Up>"),
|
||||
@ -112,11 +109,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test select up`() {
|
||||
doTest(
|
||||
listOf("<S-Up>"),
|
||||
@ -142,11 +138,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_startsel),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, OptionConstants.selectmode_key),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_key]),
|
||||
)
|
||||
@Test
|
||||
fun `test select up twice`() {
|
||||
doTest(
|
||||
listOf("<S-Up><S-Up>"),
|
||||
@ -172,11 +167,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char mode simple motion`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Up>"),
|
||||
@ -202,11 +196,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char mode to empty line`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Up>"),
|
||||
@ -232,11 +225,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char mode from empty line`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Up>"),
|
||||
@ -262,11 +254,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char mode on file start`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Up>"),
|
||||
@ -292,11 +283,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test char mode multicaret`() {
|
||||
doTest(
|
||||
listOf("gh", "<S-Up>"),
|
||||
@ -322,11 +312,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line mode simple motion`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Up>"),
|
||||
@ -352,11 +341,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line mode to empty line`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Up>"),
|
||||
@ -382,11 +370,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line mode from empty line`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Up>"),
|
||||
@ -412,11 +399,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line mode to line start`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Up>"),
|
||||
@ -442,11 +428,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test line mode multicaret`() {
|
||||
doTest(
|
||||
listOf("gH", "<S-Up>"),
|
||||
@ -472,11 +457,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test block mode simple motion`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Up>"),
|
||||
@ -502,11 +486,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test block mode to empty line`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Up>"),
|
||||
@ -532,11 +515,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test block mode from empty line`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Up>"),
|
||||
@ -562,11 +544,10 @@ class MotionShiftUpActionHandlerTest : VimOptionTestCase(OptionConstants.selectm
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.keymodel, OptionValueType.STRING, OptionConstants.keymodel_continueselect),
|
||||
VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_continueselect]),
|
||||
VimOption(OptionConstants.selectmode, limitedValues = [""]),
|
||||
)
|
||||
@Test
|
||||
fun `test block mode to line start`() {
|
||||
doTest(
|
||||
listOf("g<C-H>", "<S-Up>"),
|
||||
|
@ -81,7 +81,7 @@ class MultipleCaretsTest : VimTestCase() {
|
||||
configureByText(before)
|
||||
typeText(parseKeys("vj"))
|
||||
typeText(commandToKeys("j"))
|
||||
val after = "qwe\n" + "rty$c asd\n" + "fgh$c zxc\n" + "vbn\n"
|
||||
val after = "qwe\nrty$c asd\nfgh$c zxc\nvbn\n"
|
||||
fixture.checkResult(after)
|
||||
}
|
||||
|
||||
|
@ -11,24 +11,24 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefault
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.junit.jupiter.api.Disabled
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
/**
|
||||
* @author Alex Plate
|
||||
*/
|
||||
class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, OptionConstants.ignorecase) {
|
||||
@VimOptionDefaultAll
|
||||
@TraceOptions(OptionConstants.smartcase, OptionConstants.ignorecase)
|
||||
class SubstituteCommandTest : VimTestCase() {
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test one letter`() {
|
||||
doTest(
|
||||
exCommand("s/a/b/"),
|
||||
@ -43,9 +43,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test one letter multi per line`() {
|
||||
doTest(
|
||||
exCommand("s/a/b/g"),
|
||||
@ -60,9 +62,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test one letter multi per line whole file`() {
|
||||
doTest(
|
||||
exCommand("%s/a/b/g"),
|
||||
@ -78,9 +82,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
|
||||
// VIM-146
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test eoLto quote`() {
|
||||
doTest(
|
||||
exCommand("s/$/'/g"),
|
||||
@ -95,9 +101,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test soLto quote`() {
|
||||
doTest(
|
||||
exCommand("s/^/'/g"),
|
||||
@ -112,9 +120,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test dot to nul`() {
|
||||
doTest(
|
||||
exCommand("s/\\./\\n/g"),
|
||||
@ -124,9 +134,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
|
||||
// VIM-528
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test groups`() {
|
||||
doTest(
|
||||
exCommand("s/\\(a\\|b\\)/z\\1/g"),
|
||||
@ -135,9 +147,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test to nl`() {
|
||||
doTest(
|
||||
exCommand("s/\\./\\r/g"),
|
||||
@ -147,9 +161,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
|
||||
// VIM-289
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test dot to nlDot`() {
|
||||
doTest(
|
||||
exCommand("s/\\./\\r\\./g"),
|
||||
@ -159,9 +175,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
|
||||
// VIM-702
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test end of line to nl`() {
|
||||
doTest(
|
||||
exCommand("%s/$/\\r/g"),
|
||||
@ -185,9 +203,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
|
||||
// VIM-702
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test start of line to nl`() {
|
||||
doTest(
|
||||
exCommand("%s/^/\\r/g"),
|
||||
@ -210,10 +230,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.ignorecase, OptionValueType.NUMBER, "1"))
|
||||
@VimOptionDefault(OptionConstants.smartcase)
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, limitedValues = ["true"]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test ignorecase option`() {
|
||||
doTest(
|
||||
exCommand("%s/foo/bar/g"),
|
||||
@ -222,9 +243,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test smartcase option`() {
|
||||
// smartcase does nothing if ignorecase is not set
|
||||
doTest(
|
||||
@ -258,9 +281,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test force ignore case flag`() {
|
||||
doTest(
|
||||
exCommand("%s/foo/bar/gi"),
|
||||
@ -285,9 +310,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test force match case flag`() {
|
||||
doTest(
|
||||
exCommand("%s/foo/bar/gI"),
|
||||
@ -311,18 +338,22 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
|
||||
// VIM-864
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test visual substitute doesnt change visual marks`() {
|
||||
configureByText("foo\nbar\nbaz\n")
|
||||
typeText("V", "j", ":'<,'>s/foo/fuu/<Enter>", "gv", "~")
|
||||
assertState("FUU\nBAR\nbaz\n")
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test offset range`() {
|
||||
doTest(
|
||||
exCommand(".,+2s/a/b/g"),
|
||||
@ -331,9 +362,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test multiple carets`() {
|
||||
val before = """public class C {
|
||||
| Stri${c}ng a;
|
||||
@ -356,9 +389,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
assertState(after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test multiple carets substitute all occurrences`() {
|
||||
val before = """public class C {
|
||||
| Stri${c}ng a; String e;
|
||||
@ -381,16 +416,20 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
assertState(after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test with tabs`() {
|
||||
doTest(exCommand("s/foo/bar"), "\tfoo", "\tbar")
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test confirm all replaces all in range`() {
|
||||
// Make sure the "a" is added as part of the same injector.parser.parseKeys as the <Enter>, as it needs to be available while the
|
||||
// <Enter> is processed
|
||||
@ -409,9 +448,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test confirm all replaces all in rest of range`() {
|
||||
// Make sure the "a" is added as part of the same injector.parser.parseKeys as the <Enter>, as it needs to be available while the
|
||||
// <Enter> is processed
|
||||
@ -430,9 +471,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test confirm options`() {
|
||||
// Make sure the "a" is added as part of the same injector.parser.parseKeys as the <Enter>, as it needs to be available while the
|
||||
// <Enter> is processed
|
||||
@ -451,9 +494,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test confirm options with quit`() {
|
||||
// Make sure the "a" is added as part of the same injector.parser.parseKeys as the <Enter>, as it needs to be available while the
|
||||
// <Enter> is processed
|
||||
@ -472,9 +517,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test confirm moves caret to first match`() {
|
||||
configureByText(
|
||||
"""I found it in a legendary land
|
||||
@ -488,9 +535,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
assertPosition(0, 27)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test confirm moves caret to next match`() {
|
||||
configureByText(
|
||||
"""I found it in a legendary land
|
||||
@ -504,9 +553,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
assertPosition(1, 10)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test alternative range format`() {
|
||||
configureByText(
|
||||
"""One
|
||||
@ -530,9 +581,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test alternative range format with second dot`() {
|
||||
configureByText(
|
||||
"""One
|
||||
@ -556,9 +609,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test substitute pattern becomes last used pattern for search next`() {
|
||||
val before = """
|
||||
I found it in a legendary land
|
||||
@ -576,9 +631,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/and/or"), "n"), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-s repeats last substitution`() {
|
||||
val before = """
|
||||
${c}I found it in a legendary land
|
||||
@ -596,9 +653,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/and/or"), "j", exCommand("s")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-s repeats last substitution without range`() {
|
||||
val before = """
|
||||
I found it in a legendary land
|
||||
@ -617,9 +676,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("1,2s/d/z"), exCommand("s")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-ampersand repeats last substitution without range`() {
|
||||
val before = """
|
||||
I found it in a legendary land
|
||||
@ -638,9 +699,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("1,2s/d/z"), exCommand("&")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-s repeats last substitution with new range`() {
|
||||
val before = """
|
||||
I found it in a legendary land
|
||||
@ -659,9 +722,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("1,2s/d/z"), exCommand("1,4s")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-ampersand repeats last substitution with new range`() {
|
||||
val before = """
|
||||
I found it in a legendary land
|
||||
@ -680,9 +745,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("1,2s/d/z"), exCommand("1,4&")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-s repeats last substitution with reset flags`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}z found it in a legendary land"
|
||||
@ -692,9 +759,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/I/z/i"), exCommand("s")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-ampersand repeats last substitution with reset flags`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}z found it in a legendary land"
|
||||
@ -704,9 +773,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/I/z/i"), exCommand("&")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-s repeats last substitution with new flags`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}z found zt in a legendary land"
|
||||
@ -719,8 +790,10 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
description = "Vim supports :s[flags] but IdeaVim's command parser does not handle this." +
|
||||
"It tries to find a command called e.g. 'si'",
|
||||
)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@Disabled
|
||||
fun `test colon-s repeats last substitution with new flags (no spaces)`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
@ -729,9 +802,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/i/z"), exCommand("si")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-ampersand repeats last substitution with new flags`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}z found zt in a legendary land"
|
||||
@ -740,9 +815,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/i/z"), exCommand("& i")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-s ampersand does NOT repeat last substitution`() {
|
||||
// :s [flag] - & means use previous flags
|
||||
// See :h :& - "Note that after :substitute the '&' flag can't be used, it's recognized as a separator"
|
||||
@ -755,9 +832,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
assertPluginErrorMessageContains("Pattern not found: I")
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-ampersand-ampersand repeats last substitution with previous flags`() {
|
||||
// :s [flag] - & means use previous flags
|
||||
// See :h :& - "Note that after :substitute the '&' flag can't be used, it's recognized as a separator"
|
||||
@ -769,9 +848,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/I/z/i"), exCommand("&&")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-s repeats last substitution with count acts like line range`() {
|
||||
val before = """
|
||||
${c}I found it in a legendary land
|
||||
@ -790,9 +871,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/n/z"), exCommand("s 3")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-s repeats last substitution after search`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}I found zt zn a legendary land"
|
||||
@ -801,9 +884,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/i/z"), searchCommand("/d"), exCommand("s")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-tilde repeats last substitution with last search pattern`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}I founz zt in a legendary land"
|
||||
@ -812,9 +897,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/i/z"), searchCommand("/d"), exCommand("~")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test colon-ampersand r repeats last substitution with last search pattern`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}I founz zt in a legendary land"
|
||||
@ -823,9 +910,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/i/z"), searchCommand("/d"), exCommand("&r")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test new substitution using previous flags`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}I fouxd zt zx a legexdary laxd"
|
||||
@ -834,9 +923,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/i/z/g"), exCommand("s/n/x/&")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test replace tilde with last replace string`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}I found zzzt in a zzzegendary land"
|
||||
@ -845,9 +936,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
doTest(listOf(exCommand("s/i/zzz"), exCommand("s/l/~")), before, after)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test replace tilde with last replace string 2`() {
|
||||
val before = "${c}I found it in a legendary land"
|
||||
val after = "${c}I found zzzt in a aazzzbbzzzegendary land"
|
||||
@ -857,9 +950,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
|
||||
// VIM-2409
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test inline comment is a part of substitute command`() {
|
||||
doTest(
|
||||
exCommand("s/'/\"/g"),
|
||||
@ -869,9 +964,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
|
||||
// VIM-2417
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test bar in subsitute command`() {
|
||||
doTest(
|
||||
exCommand("%s/|/\\&"),
|
||||
@ -882,9 +979,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
|
||||
// Incsearch highlights handled by SearchGroupTest
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test underscore as delimiter`() {
|
||||
doTest(
|
||||
exCommand("s_1_2"),
|
||||
@ -893,9 +992,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test simple expression`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -914,9 +1015,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test line-dependent expression`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -935,9 +1038,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test substitute with submatch function`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -954,9 +1059,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test substitute with submatch function2`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -984,9 +1091,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test exception during expression evaluation`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -1013,9 +1122,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test invalid expression`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -1043,9 +1154,11 @@ class SubstituteCommandTest : VimOptionTestCase(OptionConstants.smartcase, Optio
|
||||
}
|
||||
|
||||
// VIM-2553
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.smartcase, doesntAffectTest = true),
|
||||
VimOption(OptionConstants.ignorecase, doesntAffectTest = true),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
|
||||
@Test
|
||||
fun `test removing consecutive matches`() {
|
||||
doTest(
|
||||
exCommand("%s/[*/]//g"),
|
||||
|
@ -14,15 +14,15 @@ import com.maddyhome.idea.vim.command.VimStateMachine
|
||||
import com.maddyhome.idea.vim.extension.exchange.VimExchangeExtension
|
||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInfo
|
||||
|
||||
class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard) {
|
||||
@TraceOptions(OptionConstants.clipboard)
|
||||
class VimExchangeWithClipboardTest : VimTestCase() {
|
||||
@Throws(Exception::class)
|
||||
@BeforeEach
|
||||
override fun setUp(testInfo: TestInfo) {
|
||||
@ -31,8 +31,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
}
|
||||
|
||||
// |cx|
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test exchange words left to right`() {
|
||||
doTest(
|
||||
listOf("cxe", "w", "cxe"),
|
||||
@ -44,8 +43,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
}
|
||||
|
||||
// |cx|
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test exchange words dot repeat`() {
|
||||
doTest(
|
||||
listOf("cxiw", "w", "."),
|
||||
@ -57,8 +55,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
}
|
||||
|
||||
// |cx|
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test exchange words right to left`() {
|
||||
doTest(
|
||||
listOf("cxe", "b", "cxe"),
|
||||
@ -70,8 +67,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
}
|
||||
|
||||
// |cx|
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test exchange words right to left with dot`() {
|
||||
doTest(
|
||||
listOf("cxe", "b", "."),
|
||||
@ -83,8 +79,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
}
|
||||
|
||||
// |X|
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test visual exchange words left to right`() {
|
||||
doTest(
|
||||
listOf("veX", "w", "veX"),
|
||||
@ -96,12 +91,11 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
}
|
||||
|
||||
// |X|
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
@VimBehaviorDiffers(
|
||||
originalVimAfter = "The ${c}brown catch over the lazy dog",
|
||||
shouldBeFixed = true,
|
||||
)
|
||||
@Test
|
||||
fun `test visual exchange words from inside`() {
|
||||
doTest(
|
||||
listOf("veX", "b", "v3e", "X"),
|
||||
@ -113,12 +107,11 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
}
|
||||
|
||||
// |X|
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
@VimBehaviorDiffers(
|
||||
originalVimAfter = "The brown ${c}catch over the lazy dog",
|
||||
shouldBeFixed = true,
|
||||
)
|
||||
@Test
|
||||
fun `test visual exchange words from outside`() {
|
||||
doTest(
|
||||
listOf("v3e", "X", "w", "veX"),
|
||||
@ -130,7 +123,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
}
|
||||
|
||||
// |cxx|
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
@VimBehaviorDiffers(
|
||||
originalVimAfter =
|
||||
"""The quick
|
||||
@ -140,7 +133,6 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
""",
|
||||
shouldBeFixed = true,
|
||||
)
|
||||
@Test
|
||||
fun `test exchange lines top down`() {
|
||||
doTest(
|
||||
listOf("cxx", "j", "cxx"),
|
||||
@ -160,7 +152,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
}
|
||||
|
||||
// |cxx|
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
@VimBehaviorDiffers(
|
||||
originalVimAfter =
|
||||
"""The quick
|
||||
@ -170,7 +162,6 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
""",
|
||||
shouldBeFixed = true,
|
||||
)
|
||||
@Test
|
||||
fun `test exchange lines top down with dot`() {
|
||||
doTest(
|
||||
listOf("cxx", "j", "."),
|
||||
@ -189,7 +180,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
@VimBehaviorDiffers(
|
||||
originalVimAfter = """
|
||||
The quick
|
||||
@ -198,7 +189,6 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
lazy dog
|
||||
""",
|
||||
)
|
||||
@Test
|
||||
fun `test exchange to the line end`() {
|
||||
doTest(
|
||||
listOf("v$", "X", "jj^ve", "X"),
|
||||
@ -217,7 +207,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
@VimBehaviorDiffers(
|
||||
originalVimAfter =
|
||||
"""
|
||||
@ -228,7 +218,6 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
""",
|
||||
shouldBeFixed = true,
|
||||
)
|
||||
@Test
|
||||
fun `test exchange visual lines`() {
|
||||
doTest(
|
||||
listOf("Vj", "X", "jj", "Vj", "X"),
|
||||
@ -250,8 +239,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test visual char highlighter`() {
|
||||
val before = """
|
||||
The ${c}quick
|
||||
@ -268,8 +256,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
exitExchange()
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test visual line highdhitligthhter`() {
|
||||
val before = """
|
||||
The ${c}quick
|
||||
@ -286,8 +273,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
exitExchange()
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test till the line end highlighter`() {
|
||||
val before = """
|
||||
The ${c}quick
|
||||
@ -302,8 +288,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
exitExchange()
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test pre line end highlighter`() {
|
||||
val before = """
|
||||
The ${c}quick
|
||||
@ -318,8 +303,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
exitExchange()
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test pre pre line end highlighter`() {
|
||||
val before = """
|
||||
The ${c}quick
|
||||
@ -334,8 +318,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
exitExchange()
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test to file end highlighter`() {
|
||||
val before = """
|
||||
The quick
|
||||
@ -357,8 +340,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
||||
exitExchange()
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboard, OptionValueType.STRING, "unnamed"))
|
||||
@Test
|
||||
@OptionTest(VimOption(OptionConstants.clipboard, limitedValues = ["unnamed"]))
|
||||
fun `test to file end with new line highlighter`() {
|
||||
val before = """
|
||||
The quick
|
||||
|
@ -12,21 +12,19 @@ package org.jetbrains.plugins.ideavim.group.motion
|
||||
|
||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
// These tests are sanity tests for scrolloff and scrolljump, with actions that move the cursor. Other actions that are
|
||||
// affected by scrolloff or scrolljump should include that in the action specific tests
|
||||
class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff) {
|
||||
@TraceOptions(OptionConstants.scrolloff)
|
||||
class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "0"))
|
||||
@Test
|
||||
fun `test move up shows no context with scrolloff=0`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["0"])) fun `test move up shows no context with scrolloff=0`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 25)
|
||||
typeText("k")
|
||||
@ -35,9 +33,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test move up shows context line with scrolloff=1`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["1"])) fun `test move up shows context line with scrolloff=1`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 26)
|
||||
typeText("k")
|
||||
@ -46,9 +42,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "10"))
|
||||
@Test
|
||||
fun `test move up shows context lines with scrolloff=10`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["10"])) fun `test move up shows context lines with scrolloff=10`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 35)
|
||||
typeText("k")
|
||||
@ -57,9 +51,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "15"))
|
||||
@Test
|
||||
fun `test move up when scrolloff is slightly less than half screen height`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["15"])) fun `test move up when scrolloff is slightly less than half screen height`() {
|
||||
// Screen height = 35. scrolloff=15. This gives 5 possible caret lines without scrolling (48, 49, 50, 51 + 52)
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(33, 52)
|
||||
@ -87,9 +79,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "16"))
|
||||
@Test
|
||||
fun `test move up when scrolloff is slightly less than half screen height 2`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["16"])) fun `test move up when scrolloff is slightly less than half screen height 2`() {
|
||||
// Screen height = 35. scrolloff=16. This gives 3 possible caret lines without scrolling (49, 50 + 51)
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(33, 51)
|
||||
@ -109,9 +99,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "16"))
|
||||
@Test
|
||||
fun `test move up when scrolloff is slightly less than half screen height 3`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["16"])) fun `test move up when scrolloff is slightly less than half screen height 3`() {
|
||||
// Screen height = 34. scrolloff=16
|
||||
// Even numbers. 2 possible caret lines without scrolling (49 + 50)
|
||||
configureByPages(5)
|
||||
@ -129,9 +117,8 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "17"))
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["17"]))
|
||||
@VimBehaviorDiffers(description = "Moving up in Vim will always have 16 lines above the caret line. IdeaVim keeps 17")
|
||||
@Test
|
||||
fun `test move up when scrolloff is exactly screen height`() {
|
||||
// Page height = 34. scrolloff=17
|
||||
// 2 possible caret lines without scrolling (49 + 50)
|
||||
@ -150,9 +137,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "17"))
|
||||
@Test
|
||||
fun `test move up when scrolloff is slightly greater than screen height keeps cursor in centre of screen`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["17"])) fun `test move up when scrolloff is slightly greater than screen height keeps cursor in centre of screen`() {
|
||||
// Page height = 35. scrolloff=17
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(33, 50)
|
||||
@ -163,9 +148,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "22"))
|
||||
@Test
|
||||
fun `test move up when scrolloff is slightly greater than screen height keeps cursor in centre of screen 2`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["22"])) fun `test move up when scrolloff is slightly greater than screen height keeps cursor in centre of screen 2`() {
|
||||
// Page height = 35. scrolloff=17
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(33, 50)
|
||||
@ -176,9 +159,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "0"))
|
||||
@Test
|
||||
fun `test move down shows no context with scrolloff=0`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["0"])) fun `test move down shows no context with scrolloff=0`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 59)
|
||||
typeText("j")
|
||||
@ -187,9 +168,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test move down shows context line with scrolloff=1`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["1"])) fun `test move down shows context line with scrolloff=1`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 58)
|
||||
typeText("j")
|
||||
@ -198,9 +177,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "10"))
|
||||
@Test
|
||||
fun `test move down shows context lines with scrolloff=10`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["10"])) fun `test move down shows context lines with scrolloff=10`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 49)
|
||||
typeText("j")
|
||||
@ -209,9 +186,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "15"))
|
||||
@Test
|
||||
fun `test move down when scrolloff is slightly less than half screen height`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["15"])) fun `test move down when scrolloff is slightly less than half screen height`() {
|
||||
// Screen height = 35. scrolloff=15. This gives 5 possible caret lines without scrolling (48, 49, 50, 51 + 52)
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(33, 48)
|
||||
@ -239,9 +214,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "16"))
|
||||
@Test
|
||||
fun `test move down when scrolloff is slightly less than half screen height 2`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["16"])) fun `test move down when scrolloff is slightly less than half screen height 2`() {
|
||||
// Screen height = 35. scrolloff=16. This gives 3 possible caret lines without scrolling (49, 50 + 51)
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(33, 49)
|
||||
@ -261,9 +234,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "16"))
|
||||
@Test
|
||||
fun `test move down when scrolloff is slightly less than half screen height 3`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["16"])) fun `test move down when scrolloff is slightly less than half screen height 3`() {
|
||||
// Screen height = 34. scrolloff=16
|
||||
// Even numbers. 2 possible caret lines without scrolling (49 + 50)
|
||||
configureByPages(5)
|
||||
@ -281,9 +252,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "17"))
|
||||
@Test
|
||||
fun `test move down when scrolloff is exactly screen height`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["17"])) fun `test move down when scrolloff is exactly screen height`() {
|
||||
// Page height = 34. scrolloff=17
|
||||
// 2 possible caret lines without scrolling (49 + 50), but moving to line 51 will scroll 2 lines!
|
||||
configureByPages(5)
|
||||
@ -301,9 +270,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "17"))
|
||||
@Test
|
||||
fun `test move down when scrolloff is slightly greater than half screen height keeps cursor in centre of screen`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["17"])) fun `test move down when scrolloff is slightly greater than half screen height keeps cursor in centre of screen`() {
|
||||
// Page height = 35. scrolloff=17
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(33, 50)
|
||||
@ -314,9 +281,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "22"))
|
||||
@Test
|
||||
fun `test move down when scrolloff is slightly greater than half screen height keeps cursor in centre of screen 2`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["22"])) fun `test move down when scrolloff is slightly greater than half screen height keeps cursor in centre of screen 2`() {
|
||||
// Page height = 35. scrolloff=17
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(33, 50)
|
||||
@ -327,9 +292,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "999"))
|
||||
@Test
|
||||
fun `test scrolloff=999 keeps cursor in centre of screen`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["999"])) fun `test scrolloff=999 keeps cursor in centre of screen`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 42)
|
||||
|
||||
@ -343,9 +306,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "999"))
|
||||
@Test
|
||||
fun `test scrolloff=999 keeps cursor in centre of screen with even screen height`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["999"])) fun `test scrolloff=999 keeps cursor in centre of screen with even screen height`() {
|
||||
configureByPages(5)
|
||||
setEditorVisibleSize(screenWidth, 34)
|
||||
setPositionAndScroll(26, 42)
|
||||
@ -360,9 +321,7 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "0"))
|
||||
@Test
|
||||
fun `test reposition cursor when scrolloff is set`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["0"])) fun `test reposition cursor when scrolloff is set`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(50, 50)
|
||||
|
||||
@ -372,11 +331,10 @@ class MotionGroup_scrolloff_Test : VimOptionTestCase(OptionConstants.scrolloff)
|
||||
}
|
||||
}
|
||||
|
||||
class MotionGroup_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump) {
|
||||
@TraceOptions(OptionConstants.scrolljump)
|
||||
class MotionGroup_scrolljump_Test : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "0"))
|
||||
@Test
|
||||
fun `test move up scrolls single line with scrolljump=0`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["0"])) fun `test move up scrolls single line with scrolljump=0`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 25)
|
||||
typeText("k")
|
||||
@ -385,9 +343,7 @@ class MotionGroup_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test move up scrolls single line with scrolljump=1`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["1"])) fun `test move up scrolls single line with scrolljump=1`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 25)
|
||||
typeText("k")
|
||||
@ -396,9 +352,7 @@ class MotionGroup_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "10"))
|
||||
@Test
|
||||
fun `test move up scrolls multiple lines with scrolljump=10`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["10"])) fun `test move up scrolls multiple lines with scrolljump=10`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 25)
|
||||
typeText("k")
|
||||
@ -407,9 +361,7 @@ class MotionGroup_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "0"))
|
||||
@Test
|
||||
fun `test move down scrolls single line with scrolljump=0`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["0"])) fun `test move down scrolls single line with scrolljump=0`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 59)
|
||||
typeText("j")
|
||||
@ -418,9 +370,7 @@ class MotionGroup_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "1"))
|
||||
@Test
|
||||
fun `test move down scrolls single line with scrolljump=1`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["1"])) fun `test move down scrolls single line with scrolljump=1`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 59)
|
||||
typeText("j")
|
||||
@ -429,9 +379,7 @@ class MotionGroup_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "10"))
|
||||
@Test
|
||||
fun `test move down scrolls multiple lines with scrolljump=10`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["10"])) fun `test move down scrolls multiple lines with scrolljump=10`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(25, 59)
|
||||
typeText("j")
|
||||
@ -440,9 +388,7 @@ class MotionGroup_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "-50"))
|
||||
@Test
|
||||
fun `test negative scrolljump treated as percentage 1`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["-50"])) fun `test negative scrolljump treated as percentage 1`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(39, 39)
|
||||
typeText("k")
|
||||
@ -451,9 +397,7 @@ class MotionGroup_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "-10"))
|
||||
@Test
|
||||
fun `test negative scrolljump treated as percentage 2`() {
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["-10"])) fun `test negative scrolljump treated as percentage 2`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(39, 39)
|
||||
typeText("k")
|
||||
@ -462,13 +406,13 @@ class MotionGroup_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump
|
||||
}
|
||||
}
|
||||
|
||||
class MotionGroup_scrolloff_scrolljump_Test : VimOptionTestCase(OptionConstants.scrolljump, OptionConstants.scrolloff) {
|
||||
@TraceOptions(OptionConstants.scrolljump, OptionConstants.scrolloff)
|
||||
class MotionGroup_scrolloff_scrolljump_Test : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "10"),
|
||||
VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "5"),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.scrolljump, limitedValues = ["10"]),
|
||||
VimOption(OptionConstants.scrolloff, limitedValues = ["5"]),
|
||||
)
|
||||
@Test
|
||||
fun `test scroll up with scrolloff and scrolljump set`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(50, 55)
|
||||
@ -478,11 +422,10 @@ class MotionGroup_scrolloff_scrolljump_Test : VimOptionTestCase(OptionConstants.
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(OptionConstants.scrolljump, OptionValueType.NUMBER, "10"),
|
||||
VimTestOption(OptionConstants.scrolloff, OptionValueType.NUMBER, "5"),
|
||||
@OptionTest(
|
||||
VimOption(OptionConstants.scrolljump, limitedValues = ["10"]),
|
||||
VimOption(OptionConstants.scrolloff, limitedValues = ["5"]),
|
||||
)
|
||||
@Test
|
||||
fun `test scroll down with scrolloff and scrolljump set`() {
|
||||
configureByPages(5)
|
||||
setPositionAndScroll(50, 79)
|
||||
|
@ -21,24 +21,19 @@ import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||
import com.maddyhome.idea.vim.helper.subMode
|
||||
import com.maddyhome.idea.vim.listener.VimListenerManager
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.waitAndAssert
|
||||
import org.jetbrains.plugins.ideavim.waitAndAssertMode
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
/**
|
||||
* @author Alex Plate
|
||||
*/
|
||||
class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
@VimOptionDefaultAll
|
||||
@TraceOptions(OptionConstants.selectmode)
|
||||
class IdeaVisualControlTest : VimTestCase() {
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection no selection`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -57,9 +52,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection cursor in the middle`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -104,9 +98,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
hard by the torrent of a mountain pass.
|
||||
""",
|
||||
)
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection cursor on end`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -141,9 +134,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection cursor on start`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -178,9 +170,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection lineend`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -215,9 +206,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection next line`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -252,9 +242,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection start on line start`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -289,9 +278,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection start on line end`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -326,9 +314,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection multicaret`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -363,9 +350,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable line selection`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -415,9 +401,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable line selection next line`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -452,9 +437,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable line selection cursor on last line`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -489,9 +473,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable line selection cursor on first line`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -526,9 +509,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable line selection multicaret`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -563,9 +545,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable line selection motion up`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -600,9 +581,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection looks like block`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -622,9 +602,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -659,9 +638,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection with longer line`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -696,9 +674,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test enable character selection caret to the left`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -733,15 +710,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
OptionConstants.selectmode,
|
||||
OptionValueType.STRING,
|
||||
OptionConstants.selectmode_ideaselection,
|
||||
),
|
||||
)
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, limitedValues = [OptionConstants.selectmode_ideaselection]))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test control selection`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -759,9 +729,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
waitAndAssertMode(fixture, VimStateMachine.Mode.SELECT)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""))
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, limitedValues = [""]))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test control selection to visual mode`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -779,9 +748,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
waitAndAssertMode(fixture, VimStateMachine.Mode.VISUAL)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""))
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, limitedValues = [""]))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test control selection from line to char visual modes`() {
|
||||
configureByText(
|
||||
"""
|
||||
@ -804,9 +772,8 @@ class IdeaVisualControlTest : VimOptionTestCase(OptionConstants.selectmode) {
|
||||
assertCaretsVisualAttributes()
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.selectmode, OptionValueType.STRING, ""))
|
||||
@OptionTest(VimOption(OptionConstants.selectmode, limitedValues = [""]))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@Test
|
||||
fun `test control selection from line to char visual modes in keep mode`() {
|
||||
configureByText(
|
||||
"""
|
||||
|
@ -28,23 +28,22 @@ import com.maddyhome.idea.vim.helper.inNormalMode
|
||||
import com.maddyhome.idea.vim.helper.inSelectMode
|
||||
import com.maddyhome.idea.vim.helper.inVisualMode
|
||||
import com.maddyhome.idea.vim.listener.VimListenerManager
|
||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimOptionDefaultAll
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.assertDoesntChange
|
||||
import org.jetbrains.plugins.ideavim.waitAndAssertMode
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInfo
|
||||
|
||||
/**
|
||||
* @author Alex Plate
|
||||
*/
|
||||
class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
@TraceOptions(IjOptionConstants.idearefactormode)
|
||||
class TemplateTest : VimTestCase() {
|
||||
|
||||
@BeforeEach
|
||||
override fun setUp(testInfo: TestInfo) {
|
||||
@ -53,8 +52,7 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@VimOptionDefaultAll
|
||||
@Test
|
||||
@OptionTest(VimOption(IjOptionConstants.idearefactormode, doesntAffectTest = true))
|
||||
fun `test simple rename`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -77,9 +75,8 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(IjOptionConstants.idearefactormode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test type rename`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -108,9 +105,8 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(IjOptionConstants.idearefactormode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test selectmode without template`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -129,9 +125,8 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
typeText(injector.parser.parseKeys("<CR>"))
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(IjOptionConstants.idearefactormode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test prepend`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -163,9 +158,8 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(IjOptionConstants.idearefactormode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test motion right`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -194,9 +188,8 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(IjOptionConstants.idearefactormode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test motion left on age`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -225,9 +218,8 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(IjOptionConstants.idearefactormode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test motion right on age`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -256,9 +248,8 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(IjOptionConstants.idearefactormode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test escape`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -287,9 +278,8 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionDefaultAll
|
||||
@OptionTest(VimOption(IjOptionConstants.idearefactormode, doesntAffectTest = true))
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test escape after typing`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -318,15 +308,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_keep,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template in normal mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -341,15 +326,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
assertDoesntChange { fixture.editor.inNormalMode }
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_keep,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test save mode for insert mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -365,15 +345,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
assertDoesntChange { fixture.editor.inInsertMode }
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_keep,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test save mode for visual mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -389,15 +364,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
assertDoesntChange { fixture.editor.inVisualMode }
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_select,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template to select in normal mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -412,15 +382,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
waitAndAssertMode(fixture, VimStateMachine.Mode.SELECT)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_select,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template to select in insert mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -436,15 +401,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
waitAndAssertMode(fixture, VimStateMachine.Mode.SELECT)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_select,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template to select in visual mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -460,15 +420,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
assertDoesntChange { fixture.editor.inVisualMode }
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_select,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template to select in select mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -484,15 +439,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
assertDoesntChange { fixture.editor.inSelectMode }
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_visual,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template to visual in normal mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -507,15 +457,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
waitAndAssertMode(fixture, VimStateMachine.Mode.VISUAL)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_visual,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template to visual in insert mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -531,15 +476,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
waitAndAssertMode(fixture, VimStateMachine.Mode.VISUAL)
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_visual,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template to visual in visual mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -555,15 +495,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
assertDoesntChange { fixture.editor.inVisualMode }
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_visual,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template to visual in select mode`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
@ -579,15 +514,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
assertDoesntChange { fixture.editor.inSelectMode }
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_keep,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template with multiple times`() {
|
||||
configureByJavaText(c)
|
||||
val manager = TemplateManager.getInstance(fixture.project)
|
||||
@ -607,15 +537,10 @@ class TemplateTest : VimOptionTestCase(IjOptionConstants.idearefactormode) {
|
||||
kotlin.test.assertNull(TemplateManagerImpl.getTemplateState(fixture.editor))
|
||||
}
|
||||
|
||||
@VimOptionTestConfiguration(
|
||||
VimTestOption(
|
||||
IjOptionConstants.idearefactormode,
|
||||
OptionValueType.STRING,
|
||||
IjOptionConstants.idearefactormode_keep,
|
||||
),
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
@Test
|
||||
fun `test template with lookup`() {
|
||||
configureByJavaText(
|
||||
"""
|
||||
|
@ -0,0 +1,395 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package org.jetbrains.plugins.ideavim.impl
|
||||
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
|
||||
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
|
||||
import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.VimOptionGroup
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.diagnostic.vimLogger
|
||||
import com.maddyhome.idea.vim.group.IjOptionConstants
|
||||
import com.maddyhome.idea.vim.options.NumberOption
|
||||
import com.maddyhome.idea.vim.options.Option
|
||||
import com.maddyhome.idea.vim.options.OptionChangeListener
|
||||
import com.maddyhome.idea.vim.options.OptionConstants
|
||||
import com.maddyhome.idea.vim.options.OptionScope
|
||||
import com.maddyhome.idea.vim.options.OptionValueAccessor
|
||||
import com.maddyhome.idea.vim.options.StringOption
|
||||
import com.maddyhome.idea.vim.options.ToggleOption
|
||||
import com.maddyhome.idea.vim.options.UnsignedNumberOption
|
||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimDataType
|
||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimInt
|
||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString
|
||||
import org.jetbrains.plugins.ideavim.product
|
||||
import org.junit.jupiter.api.TestTemplate
|
||||
import org.junit.jupiter.api.extension.AfterTestExecutionCallback
|
||||
import org.junit.jupiter.api.extension.BeforeTestExecutionCallback
|
||||
import org.junit.jupiter.api.extension.ExtendWith
|
||||
import org.junit.jupiter.api.extension.Extension
|
||||
import org.junit.jupiter.api.extension.ExtensionContext
|
||||
import org.junit.jupiter.api.extension.TestTemplateInvocationContext
|
||||
import org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.stream.Stream
|
||||
import kotlin.test.fail
|
||||
|
||||
/**
|
||||
* Enables option tracing
|
||||
*
|
||||
* If this annotation is presented, tests will trace if any of [optionNames] option was accessed.
|
||||
* If any of these options were accessed, they should be presented in [OptionTest] annotation that defines
|
||||
* options behaviour for this test.
|
||||
* This annotation is not necessary is usable for self-check
|
||||
*
|
||||
* Possible usage: At some moment, the usage of this annotation can be extended, and we can verify what options
|
||||
* were accessed during test run. Such tests can be started multiple times for different values of accessed option.
|
||||
* At the moment, this functionality is not implemented and the amount of tests grows exponentially.
|
||||
*/
|
||||
@ExtendWith(OptionsVerificator::class)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class TraceOptions(vararg val optionNames: String)
|
||||
|
||||
/**
|
||||
* Defines values of options for tests. Test will be started multiple times with all possible combinations
|
||||
* of the defined options.
|
||||
* Read the doc for [VimOption] to understand how the option can be defined
|
||||
*/
|
||||
@ExtendWith(VimOptionsInvocator::class)
|
||||
@TestTemplate
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
internal annotation class OptionTest(vararg val value: VimOption)
|
||||
|
||||
/**
|
||||
* Defines the values that will be used for the option.
|
||||
* Test will be started multiple times for every possible value. If there are multiple [VimOption] presented
|
||||
* in [OptionTest] container, test will be started for all possible combinations for the option.
|
||||
*
|
||||
* If only option name is specified, the values for the option will be automatically generated (if possible).
|
||||
* See next sections to understand what values are automatically generated.
|
||||
*
|
||||
* [limitedValues] if this field is presented, options values will be taken from this field.
|
||||
* - Use just a string for string option
|
||||
* - Use "true" or "false" for boolean option
|
||||
* - Use number in quotes "1" for number options
|
||||
*
|
||||
* [doesntAffectTest] field means that this option doesn't affect test, event the option is read.
|
||||
* For classic test configuration, this means that the default value will be used.
|
||||
*
|
||||
* However, in OptionVerificationTest (WIP) configuration, we'll run this test against all possible option values.
|
||||
* This behaviour is not used by default as it dramatically increases the amount of tests and execution time.
|
||||
*
|
||||
* # Option values generation
|
||||
*
|
||||
* If only the option name is defined, the following values will be automatically generated:
|
||||
* - For boolean option: true, false
|
||||
* - For number option:
|
||||
* - Signed: -1000, -10, -1, 0, 1, 10, 1000
|
||||
* - Unsigned: 0, 1, 10, 1000
|
||||
* - For string option:
|
||||
* - With bounded list:
|
||||
* - Single value option: all values from the list
|
||||
* - Multiple values option: all possible combinations of values from the list
|
||||
* - Without bounded list:
|
||||
* - Not supported, please specify possible values using [limitedValues]
|
||||
*/
|
||||
internal annotation class VimOption(
|
||||
val name: String,
|
||||
val limitedValues: Array<String> = [],
|
||||
val doesntAffectTest: Boolean = false,
|
||||
)
|
||||
|
||||
|
||||
// ----------- Implementation
|
||||
|
||||
private class OptionsVerificator : BeforeTestExecutionCallback, AfterTestExecutionCallback {
|
||||
override fun beforeTestExecution(context: ExtensionContext) {
|
||||
val testInjector = TestInjector(injector)
|
||||
val traceCollector = OptionsTraceCollector()
|
||||
val ignore = AtomicBoolean(false)
|
||||
getStore(context).put("TraceCollector", traceCollector)
|
||||
testInjector.setTracer(OptionsTracer, traceCollector)
|
||||
testInjector.setTracer("OptionTracerIgnore", ignore)
|
||||
injector = testInjector
|
||||
}
|
||||
|
||||
override fun afterTestExecution(context: ExtensionContext) {
|
||||
val collector = getStore(context).get("TraceCollector", OptionsTraceCollector::class.java)
|
||||
val usedOptions = collector.requestedKeys
|
||||
.mapNotNull { injector.optionGroup.getOption(it)?.name }
|
||||
.toSet()
|
||||
val traceOptions = context.testClass.get().getAnnotation(TraceOptions::class.java)
|
||||
?: error("This extension should be used via @TraceOption annotation")
|
||||
val usedTracedOptions = usedOptions.filter { it in traceOptions.optionNames }
|
||||
val usedOptionsWithoutIgnored = usedTracedOptions.filterNot { it in ignored }
|
||||
val optionAnnotation: OptionTest? = context.testMethod.get().getAnnotation(OptionTest::class.java)
|
||||
if (optionAnnotation == null && usedOptionsWithoutIgnored.isEmpty()) return
|
||||
if (optionAnnotation == null) {
|
||||
fail("Specify @OptionTest annotation for the following options: ${usedOptionsWithoutIgnored.joinToString()}")
|
||||
}
|
||||
val specifiedNames = optionAnnotation.value.map { it.name }.toSet()
|
||||
val usedButNotSpecified = usedOptionsWithoutIgnored.filterNot { it in specifiedNames }
|
||||
if (usedButNotSpecified.isNotEmpty()) {
|
||||
fail("Options accessed: ${usedButNotSpecified.joinToString()}. Please specify the explicitly using @OptionTest annotation")
|
||||
}
|
||||
val specifiedButNotUsed = specifiedNames.filter { it !in usedOptions }
|
||||
if (specifiedButNotUsed.isNotEmpty()) {
|
||||
LOG.warn("Options $specifiedButNotUsed are specified in annotation, but not actually used")
|
||||
}
|
||||
}
|
||||
|
||||
private fun getStore(context: ExtensionContext): ExtensionContext.Store {
|
||||
return context.getStore(ExtensionContext.Namespace.create(javaClass, context.requiredTestMethod))
|
||||
}
|
||||
|
||||
companion object {
|
||||
val LOG by lazy { vimLogger<OptionsVerificator>() }
|
||||
private val ignored = setOf(
|
||||
OptionConstants.guicursor,
|
||||
OptionConstants.ideaglobalmode,
|
||||
OptionConstants.ideatracetime,
|
||||
OptionConstants.number,
|
||||
OptionConstants.timeoutlen,
|
||||
OptionConstants.relativenumber,
|
||||
OptionConstants.maxmapdepth,
|
||||
OptionConstants.octopushandler,
|
||||
IjOptionConstants.ideavimsupport,
|
||||
"unifyjumps",
|
||||
OptionConstants.sidescrolloff,
|
||||
OptionConstants.sidescroll,
|
||||
OptionConstants.scrolloff,
|
||||
OptionConstants.scrolljump,
|
||||
IjOptionConstants.trackactionids,
|
||||
OptionConstants.showmode,
|
||||
OptionConstants.virtualedit,
|
||||
OptionConstants.whichwrap,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
internal class OptionsTraceCollector {
|
||||
val requestedKeys = HashSet<String>()
|
||||
}
|
||||
|
||||
internal class OptionsTracer(
|
||||
private val vimOptionGroup: VimOptionGroup,
|
||||
private val trace: OptionsTraceCollector,
|
||||
private val ignoreFlag: AtomicBoolean,
|
||||
) : VimOptionGroup by vimOptionGroup {
|
||||
override fun getOption(key: String): Option<out VimDataType>? {
|
||||
if (!ignoreFlag.get()) {
|
||||
trace.requestedKeys += key
|
||||
}
|
||||
return vimOptionGroup.getOption(key)
|
||||
}
|
||||
|
||||
override fun getAllOptions(): Set<Option<out VimDataType>> {
|
||||
val allOptions = vimOptionGroup.getAllOptions()
|
||||
if (!ignoreFlag.get()) {
|
||||
allOptions.forEach { trace.requestedKeys += it.name }
|
||||
}
|
||||
return allOptions
|
||||
}
|
||||
|
||||
override fun getOptionValue(option: Option<out VimDataType>, scope: OptionScope): VimDataType {
|
||||
if (!ignoreFlag.get()) {
|
||||
trace.requestedKeys += option.name
|
||||
}
|
||||
return vimOptionGroup.getOptionValue(option, scope)
|
||||
}
|
||||
|
||||
override fun addListener(optionName: String, listener: OptionChangeListener<VimDataType>, executeOnAdd: Boolean) {
|
||||
ignoreFlag.set(true)
|
||||
try {
|
||||
vimOptionGroup.addListener(optionName, listener, executeOnAdd)
|
||||
} finally {
|
||||
ignoreFlag.set(false)
|
||||
}
|
||||
}
|
||||
|
||||
override fun removeListener(optionName: String, listener: OptionChangeListener<VimDataType>) {
|
||||
ignoreFlag.set(true)
|
||||
try {
|
||||
vimOptionGroup.removeListener(optionName, listener)
|
||||
} finally {
|
||||
ignoreFlag.set(false)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getValueAccessor(editor: VimEditor?): OptionValueAccessor {
|
||||
// I don't like this solution. Would love to see something better without rewrapping.
|
||||
// The point is that OptionValueAccesor should use our group to be property traced
|
||||
val accessor = vimOptionGroup.getValueAccessor(editor)
|
||||
return OptionValueAccessor(this, accessor.scope)
|
||||
}
|
||||
|
||||
companion object
|
||||
}
|
||||
|
||||
private class VimOptionsInvocator : TestTemplateInvocationContextProvider {
|
||||
override fun supportsTestTemplate(context: ExtensionContext?): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun provideTestTemplateInvocationContexts(context: ExtensionContext): Stream<TestTemplateInvocationContext> {
|
||||
val fixture = fixtureSetup()
|
||||
try {
|
||||
return generateContextes(context)
|
||||
} finally {
|
||||
fixture.tearDown()
|
||||
}
|
||||
}
|
||||
|
||||
// Sometimes we need an injector before @BeforeEach function is executed. We set up and tear down the project for this case
|
||||
private fun fixtureSetup(): CodeInsightTestFixture {
|
||||
val factory = IdeaTestFixtureFactory.getFixtureFactory()
|
||||
val projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR
|
||||
val fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor, "IdeaVim")
|
||||
val fixture = fixtureBuilder.fixture
|
||||
val myfixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(
|
||||
fixture,
|
||||
LightTempDirTestFixtureImpl(true),
|
||||
)
|
||||
myfixture.setUp()
|
||||
return myfixture
|
||||
}
|
||||
|
||||
private fun generateContextes(context: ExtensionContext): Stream<TestTemplateInvocationContext> {
|
||||
val annotation = context.testMethod.get().getAnnotation(OptionTest::class.java)
|
||||
val options: List<List<Pair<Option<out VimDataType>, VimDataType?>>> = annotation.value.map {
|
||||
val optionName = it.name
|
||||
val option = injector.optionGroup.getOption(optionName)!!
|
||||
if (!it.doesntAffectTest) {
|
||||
if (it.limitedValues.isEmpty()) {
|
||||
defaultOptionCombinations(option)
|
||||
} else {
|
||||
when (option) {
|
||||
is ToggleOption -> it.limitedValues.map { option to if (it == "true") VimInt.ONE else VimInt.ZERO }
|
||||
is NumberOption -> it.limitedValues.map { option to VimInt(it) }
|
||||
is StringOption -> {
|
||||
it.limitedValues.map { limitedValue -> option to VimString(limitedValue) }
|
||||
}
|
||||
|
||||
else -> error("Unexpected option type: $option")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
listOf(option to null)
|
||||
}
|
||||
}
|
||||
return product(*options.toTypedArray())
|
||||
.map {
|
||||
// Some wierd kotlin bug. Code doesn't compile without this cast
|
||||
@Suppress("USELESS_CAST")
|
||||
VimOptionsInvocationContext(it) as TestTemplateInvocationContext
|
||||
}
|
||||
.stream()
|
||||
}
|
||||
|
||||
private fun defaultOptionCombinations(option: Option<out VimDataType>): List<Pair<Option<out VimDataType>, VimDataType>> {
|
||||
return when (option) {
|
||||
is ToggleOption -> listOf(option to VimInt.ONE, option to VimInt.ZERO)
|
||||
is NumberOption -> {
|
||||
val vals = if (option is UnsignedNumberOption) {
|
||||
listOf(VimInt.ZERO, VimInt.ONE, VimInt(10), VimInt(1000))
|
||||
} else {
|
||||
listOf(VimInt(-1000), VimInt(-10), VimInt(-1), VimInt.ZERO, VimInt.ONE, VimInt(10), VimInt(1000))
|
||||
}
|
||||
vals.map { option to it }
|
||||
}
|
||||
|
||||
is StringOption -> {
|
||||
if (option.isList) {
|
||||
val boundedValues = option.boundedValues
|
||||
if (boundedValues != null) {
|
||||
val valuesCombinations = boundedValues.indices.map {
|
||||
kCombinations(boundedValues.toList(), it + 1)
|
||||
.map { VimString(it.joinToString(",")) }
|
||||
}.flatten()
|
||||
valuesCombinations.map { option to it }
|
||||
} else fail("Cannot generate values automatically. Please specify option values explicitelly using 'limitedValues' field")
|
||||
} else {
|
||||
val boundedValues = option.boundedValues
|
||||
if (boundedValues != null) {
|
||||
boundedValues.map { option to VimString(it) }
|
||||
} else {
|
||||
fail("Cannot generate values automatically. Please specify option values explicitelly using 'limitedValues' field")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else -> error("Unexpected option type: $option")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Yeah, MATHEMATICS!!!
|
||||
private fun <T> kCombinations(input: List<T>, sequenceLength: Int): List<List<T>> {
|
||||
val subsets: MutableList<List<T>> = ArrayList()
|
||||
|
||||
val s = IntArray(sequenceLength) // here we'll keep indices
|
||||
|
||||
if (sequenceLength <= input.size) {
|
||||
var i = 0
|
||||
while (i.also { s[i] = it } < sequenceLength - 1) {
|
||||
i++
|
||||
}
|
||||
subsets.add(getSubset(input, s))
|
||||
while (true) {
|
||||
var i: Int = sequenceLength - 1
|
||||
while (i >= 0 && s[i] == input.size - sequenceLength + i) {
|
||||
i--
|
||||
}
|
||||
if (i < 0) {
|
||||
break
|
||||
}
|
||||
s[i]++ // increment this item
|
||||
++i
|
||||
while (i < sequenceLength) {
|
||||
// fill up remaining items
|
||||
s[i] = s[i - 1] + 1
|
||||
i++
|
||||
}
|
||||
subsets.add(getSubset(input, s))
|
||||
}
|
||||
}
|
||||
return subsets
|
||||
}
|
||||
|
||||
// generate actual subset by index sequence
|
||||
private fun <T> getSubset(input: List<T>, subset: IntArray): List<T> {
|
||||
val result = ArrayList<T>()
|
||||
for (i in subset.indices) {
|
||||
result += input[subset[i]]
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
class VimOptionsInvocationContext(private val options: List<Pair<Option<out VimDataType>, VimDataType?>>) :
|
||||
TestTemplateInvocationContext {
|
||||
override fun getDisplayName(invocationIndex: Int): String {
|
||||
return options.joinToString(separator = "; ") { "${it.first.name}=${it.second ?: "[default]"}" }
|
||||
}
|
||||
|
||||
override fun getAdditionalExtensions(): List<Extension> {
|
||||
return listOf(OptionsSetup(options))
|
||||
}
|
||||
}
|
||||
|
||||
class OptionsSetup(private val options: List<Pair<Option<*>, VimDataType?>>) : BeforeTestExecutionCallback {
|
||||
override fun beforeTestExecution(context: ExtensionContext?) {
|
||||
options.forEach { (key, value) ->
|
||||
if (value != null) {
|
||||
injector.optionGroup.setOptionValue(key, OptionScope.GLOBAL, value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package org.jetbrains.plugins.ideavim.impl
|
||||
|
||||
import com.maddyhome.idea.vim.api.VimInjector
|
||||
import com.maddyhome.idea.vim.api.VimOptionGroup
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
/**
|
||||
* Test injector that can wraps the original injector and add some functionality
|
||||
*
|
||||
* THIS IS NECESSARY to be careful with it!
|
||||
* It's not supposed to be used to change the injector behaviour in tests. It only should cause some side effects
|
||||
* that DOESN'T affect execution. For example, this may collect additional information about options access
|
||||
*/
|
||||
class TestInjector(val injector: VimInjector) : VimInjector by injector {
|
||||
private val tracers: MutableMap<Any, Any> = HashMap()
|
||||
|
||||
fun setTracer(key: Any, collector: Any) {
|
||||
tracers[key] = collector
|
||||
}
|
||||
|
||||
override val optionGroup: VimOptionGroup
|
||||
get() {
|
||||
val tracer = tracers[OptionsTracer] as? OptionsTraceCollector
|
||||
return if (tracer != null) {
|
||||
val ignoreFlag = tracers["OptionTracerIgnore"] as AtomicBoolean
|
||||
OptionsTracer(injector.optionGroup, tracer, ignoreFlag)
|
||||
} else {
|
||||
injector.optionGroup
|
||||
}
|
||||
}
|
||||
}
|
@ -48,7 +48,7 @@ public abstract class Option<T : VimDataType>(public val name: String, public va
|
||||
public abstract fun parseValue(value: String, token: String): VimDataType
|
||||
}
|
||||
|
||||
public open class StringOption(name: String, abbrev: String, defaultValue: VimString, private val isList: Boolean = false, private val boundedValues: Collection<String>? = null) : Option<VimString>(name, abbrev, defaultValue) {
|
||||
public open class StringOption(name: String, abbrev: String, defaultValue: VimString, public val isList: Boolean = false, public val boundedValues: Collection<String>? = null) : Option<VimString>(name, abbrev, defaultValue) {
|
||||
public constructor(name: String, abbrev: String, defaultValue: String, isList: Boolean = false, boundedValues: Collection<String>? = null) : this(name, abbrev, VimString(defaultValue), isList, boundedValues)
|
||||
|
||||
override fun checkIfValueValid(value: VimDataType, token: String) {
|
||||
|
@ -23,7 +23,7 @@ import com.maddyhome.idea.vim.vimscript.services.OptionService
|
||||
* All functions assume that the option exists, and that the calling code knows what type to expect. Trying to retrieve
|
||||
* a non-existent option, or calling the wrong accessor will lead to exceptions or incorrect behaviour.
|
||||
*/
|
||||
public class OptionValueAccessor(private val optionGroup: VimOptionGroup, private val scope: OptionScope) {
|
||||
public class OptionValueAccessor(private val optionGroup: VimOptionGroup, public val scope: OptionScope) {
|
||||
/** Gets the loosely typed option value */
|
||||
public fun getValue(optionName: String): VimDataType = optionGroup.getOptionValue(optionGroup.getOption(optionName)!!, scope)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user