mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-06-02 13:34:07 +02:00
Code cleanup
This commit is contained in:
parent
edf9962abf
commit
e30e194b91
src/test/java/org/jetbrains/plugins/ideavim
NeovimTesting.kt
action
ChangeNumberActionTest.ktSpecialRegistersTest.kt
change/delete
DeleteJoinLinesSpacesActionTest.ktDeleteJoinVisualLinesSpacesActionTest.ktDeleteVisualLinesEndActionTest.ktJoinNotificationTest.kt
copy
motion
leftright
MotionArrowLeftActionTest.ktMotionArrowRightActionTest.ktMotionEndActionTest.ktMotionHomeActionTest.ktMotionRightActionTest.ktMotionShiftHomeActionTest.ktMotionShiftLeftActionHandlerTest.ktMotionShiftRightActionHandlerTest.kt
mark
select/motion
updown
scroll
ex/implementation/commands
extension/exchange
group
helper
impl
@ -14,7 +14,6 @@ import com.ensarsarajcic.neovim.java.api.types.api.VimCoords
|
||||
import com.ensarsarajcic.neovim.java.corerpc.client.ProcessRpcConnection
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.LogicalPosition
|
||||
import com.intellij.util.containers.toArray
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.SelectionType
|
||||
import com.maddyhome.idea.vim.common.CharacterPosition
|
||||
@ -31,7 +30,6 @@ 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.TestInfo
|
||||
import org.junit.jupiter.params.provider.Arguments
|
||||
|
||||
internal object NeovimTesting {
|
||||
private lateinit var neovimApi: NeovimApi
|
||||
|
@ -10,9 +10,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.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class ChangeNumberActionTest : VimTestCase() {
|
||||
|
@ -13,7 +13,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.SMALL_DELETION_REGISTER
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.junit.Assert
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInfo
|
||||
@ -200,7 +199,7 @@ class SpecialRegistersTest : VimTestCase() {
|
||||
|
||||
private fun assertRegisterChanged(registerName: Char) {
|
||||
val registerText = getRegisterText(registerName)
|
||||
Assert.assertNotEquals(DUMMY_TEXT, registerText)
|
||||
assertNotEquals(DUMMY_TEXT, registerText)
|
||||
}
|
||||
|
||||
private fun assertRegisterNotChanged(registerName: Char) {
|
||||
|
@ -10,12 +10,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions
|
||||
class DeleteJoinLinesSpacesActionTest : VimTestCase() {
|
||||
|
@ -10,12 +10,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions
|
||||
class DeleteJoinVisualLinesSpacesActionTest : VimTestCase() {
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.virtualedit)
|
||||
class DeleteVisualLinesEndActionTest : VimTestCase() {
|
||||
@ -659,7 +659,8 @@ class DeleteVisualLinesEndActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore])) fun `test change dollar`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]))
|
||||
fun `test change dollar`() {
|
||||
doTest(
|
||||
"c$",
|
||||
"""
|
||||
|
@ -16,10 +16,10 @@ 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.impl.VimOption
|
||||
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.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
|
||||
/**
|
||||
* @author Alex Plate
|
||||
|
@ -16,10 +16,10 @@ 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.impl.VimOption
|
||||
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.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.rangeOf
|
||||
|
||||
@TraceOptions(OptionConstants.clipboard)
|
||||
|
@ -10,10 +10,10 @@ 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.impl.VimOption
|
||||
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.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
|
||||
@TraceOptions(OptionConstants.clipboard)
|
||||
class YankAndPutTest : VimTestCase() {
|
||||
|
@ -13,12 +13,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionArrowLeftActionTest : VimTestCase() {
|
||||
|
@ -13,12 +13,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionArrowRightActionTest : VimTestCase() {
|
||||
@ -236,7 +236,7 @@ class MotionArrowRightActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test visual stopselect`() {
|
||||
doTest(
|
||||
listOf("v", "<Right>"),
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionEndActionTest : VimTestCase() {
|
||||
@ -45,7 +45,7 @@ class MotionEndActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test continue visual`() {
|
||||
val keys = listOf("v", "<End>")
|
||||
val before = """
|
||||
@ -68,7 +68,7 @@ class MotionEndActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test continue select`() {
|
||||
val keys = listOf("gh", "<End>")
|
||||
val before = """
|
||||
@ -91,7 +91,8 @@ class MotionEndActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual])) 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
|
||||
@ -113,7 +114,7 @@ class MotionEndActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test exit select`() {
|
||||
val keys = listOf("gh", "<End>")
|
||||
val before = """
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionHomeActionTest : VimTestCase() {
|
||||
@ -51,7 +51,7 @@ class MotionHomeActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test continue visual`() {
|
||||
val keys = listOf("v", "<Home>")
|
||||
val before = """
|
||||
@ -74,7 +74,7 @@ class MotionHomeActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [""]))
|
||||
fun `test continue select`() {
|
||||
val keys = listOf("gh", "<Home>")
|
||||
val before = """
|
||||
@ -97,7 +97,8 @@ class MotionHomeActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopvisual])) 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
|
||||
@ -119,7 +120,7 @@ class MotionHomeActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
@OptionTest(VimOption(OptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect]))
|
||||
fun `test exit select`() {
|
||||
val keys = listOf("gh", "<Home>")
|
||||
val before = """
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.virtualedit)
|
||||
class MotionRightActionTest : VimTestCase() {
|
||||
@ -97,7 +97,8 @@ class MotionRightActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore])) 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",
|
||||
"""
|
||||
@ -116,7 +117,8 @@ class MotionRightActionTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore])) fun `test virtual edit motion after dollar`() {
|
||||
@OptionTest(VimOption(OptionConstants.virtualedit, limitedValues = [OptionConstants.virtualedit_onemore]))
|
||||
fun `test virtual edit motion after dollar`() {
|
||||
doTest(
|
||||
"\$l",
|
||||
"""
|
||||
|
@ -13,12 +13,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.selectmode)
|
||||
class MotionShiftHomeActionTest : VimTestCase() {
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.selectmode)
|
||||
class MotionShiftLeftActionHandlerTest : VimTestCase() {
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.selectmode)
|
||||
class MotionShiftRightActionHandlerTest : VimTestCase() {
|
||||
|
@ -15,14 +15,15 @@ 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.impl.VimOption
|
||||
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.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
|
||||
@TraceOptions(IjOptionConstants.ideamarks)
|
||||
class MotionMarkActionTest : VimTestCase() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) fun `test simple add mark`() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"]))
|
||||
fun `test simple add mark`() {
|
||||
val keys = injector.parser.parseKeys("mA")
|
||||
val text = """
|
||||
A Discovery
|
||||
@ -37,7 +38,8 @@ class MotionMarkActionTest : VimTestCase() {
|
||||
checkMarks('A' to 2)
|
||||
}
|
||||
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) 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
|
||||
@ -52,7 +54,8 @@ class MotionMarkActionTest : VimTestCase() {
|
||||
checkMarks('A' to 2, 'B' to 3, 'C' to 4)
|
||||
}
|
||||
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) 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
|
||||
@ -70,7 +73,8 @@ class MotionMarkActionTest : VimTestCase() {
|
||||
// checkMarks('A' to 2, 'B' to 2, 'C' to 2)
|
||||
}
|
||||
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) 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
|
||||
@ -85,7 +89,8 @@ class MotionMarkActionTest : VimTestCase() {
|
||||
checkMarks('A' to 4)
|
||||
}
|
||||
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) fun `test simple system mark`() {
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"]))
|
||||
fun `test simple system mark`() {
|
||||
val text = """
|
||||
A Discovery
|
||||
|
||||
@ -102,7 +107,8 @@ class MotionMarkActionTest : VimTestCase() {
|
||||
kotlin.test.assertEquals('A', vimMarks.first().key)
|
||||
}
|
||||
|
||||
@OptionTest(VimOption(IjOptionConstants.ideamarks, limitedValues = ["true"])) 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,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class SelectMotionLeftActionTest : VimTestCase() {
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class SelectMotionRightActionTest : VimTestCase() {
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.virtualedit)
|
||||
class MotionArrowDownActionTest : VimTestCase() {
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel)
|
||||
class MotionArrowUpActionTest : VimTestCase() {
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.keymodel, OptionConstants.selectmode)
|
||||
class MotionShiftDownActionHandlerTest : VimTestCase() {
|
||||
|
@ -12,12 +12,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
@TraceOptions(OptionConstants.selectmode, OptionConstants.keymodel)
|
||||
class MotionShiftUpActionHandlerTest : VimTestCase() {
|
||||
|
@ -12,7 +12,6 @@ import com.intellij.openapi.editor.Inlay
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.junit.Assert
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@ -74,7 +73,7 @@ class ScrollFirstScreenColumnActionTest : VimTestCase() {
|
||||
|
||||
// The first visible text column will be 99, with the inlay positioned to the left of it
|
||||
assertVisibleLineBounds(0, 99, 99 + availableColumns - 1)
|
||||
Assert.assertEquals(visibleArea.x, inlay.bounds!!.x)
|
||||
assertEquals(visibleArea.x, inlay.bounds!!.x)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -11,7 +11,6 @@ package org.jetbrains.plugins.ideavim.action.scroll
|
||||
import com.intellij.openapi.editor.Inlay
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.junit.Assert
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@ -112,8 +111,8 @@ class ScrollLastScreenColumnActionTest : VimTestCase() {
|
||||
|
||||
// We have to assert the location of the inlay
|
||||
val inlayX = fixture.editor.visualPositionToPoint2D(inlay.visualPosition).x.roundToInt()
|
||||
Assert.assertEquals(visibleArea.x + textWidth, inlayX)
|
||||
Assert.assertEquals(visibleArea.x + visibleArea.width, inlayX + inlay.widthInPixels)
|
||||
assertEquals(visibleArea.x + textWidth, inlayX)
|
||||
assertEquals(visibleArea.x + visibleArea.width, inlayX + inlay.widthInPixels)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -11,12 +11,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
import org.junit.jupiter.api.Disabled
|
||||
|
||||
/**
|
||||
|
@ -14,10 +14,10 @@ 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.impl.VimOption
|
||||
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.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.TestInfo
|
||||
|
||||
|
@ -135,7 +135,7 @@ class SearchGroupTest : VimTestCase() {
|
||||
"\\c[ABC]b",
|
||||
"${c}dd\n",
|
||||
)
|
||||
kotlin.test.assertEquals(-1, pos)
|
||||
assertEquals(-1, pos)
|
||||
}
|
||||
|
||||
// VIM-856
|
||||
@ -146,7 +146,7 @@ class SearchGroupTest : VimTestCase() {
|
||||
"a\\@<!b",
|
||||
"${c}ab\n",
|
||||
)
|
||||
kotlin.test.assertEquals(-1, pos)
|
||||
assertEquals(-1, pos)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.DIFFERENT)
|
||||
@ -1518,7 +1518,7 @@ class SearchGroupTest : VimTestCase() {
|
||||
@Test
|
||||
fun `test find last cr in file`() {
|
||||
val res = search("\\n", "Something\n")
|
||||
kotlin.test.assertEquals(9, res)
|
||||
assertEquals(9, res)
|
||||
}
|
||||
|
||||
private fun search(pattern: String, input: String): Int {
|
||||
@ -1541,7 +1541,7 @@ class SearchGroupTest : VimTestCase() {
|
||||
}
|
||||
|
||||
private fun assertNoSearchHighlights() {
|
||||
kotlin.test.assertEquals(0, fixture.editor.markupModel.allHighlighters.size)
|
||||
assertEquals(0, fixture.editor.markupModel.allHighlighters.size)
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@ -1572,7 +1572,7 @@ class SearchGroupTest : VimTestCase() {
|
||||
offset += v.length
|
||||
}
|
||||
|
||||
kotlin.test.assertEquals(expected, actual.toString())
|
||||
assertEquals(expected, actual.toString())
|
||||
|
||||
// Assert all highlighters have the correct tooltip and text attributes
|
||||
val editorColorsScheme = EditorColorsManager.getInstance().globalScheme
|
||||
@ -1580,7 +1580,7 @@ class SearchGroupTest : VimTestCase() {
|
||||
val caretColour = editorColorsScheme.getColor(EditorColors.CARET_COLOR)
|
||||
allHighlighters.forEach {
|
||||
val offsets = "(${it.startOffset}, ${it.endOffset})"
|
||||
kotlin.test.assertEquals(tooltip, it.errorStripeTooltip, "Incorrect tooltip for highlighter at $offsets")
|
||||
assertEquals(tooltip, it.errorStripeTooltip, "Incorrect tooltip for highlighter at $offsets")
|
||||
assertEquals(
|
||||
attributes.backgroundColor,
|
||||
it.textAttributes?.backgroundColor,
|
||||
|
@ -12,19 +12,20 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
|
||||
// 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
|
||||
@TraceOptions(OptionConstants.scrolloff)
|
||||
class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["0"])) 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")
|
||||
@ -33,7 +34,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["1"])) 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")
|
||||
@ -42,7 +44,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["10"])) 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")
|
||||
@ -51,7 +54,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["15"])) 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)
|
||||
@ -79,7 +83,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["16"])) 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)
|
||||
@ -99,7 +104,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["16"])) 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)
|
||||
@ -137,7 +143,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["17"])) 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)
|
||||
@ -148,7 +155,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@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`() {
|
||||
@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)
|
||||
@ -159,7 +167,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["0"])) 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")
|
||||
@ -168,7 +177,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["1"])) 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")
|
||||
@ -177,7 +187,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["10"])) 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")
|
||||
@ -186,7 +197,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["15"])) 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)
|
||||
@ -214,7 +226,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["16"])) 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)
|
||||
@ -234,7 +247,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["16"])) 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)
|
||||
@ -252,7 +266,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["17"])) 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)
|
||||
@ -270,7 +285,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@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`() {
|
||||
@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)
|
||||
@ -281,7 +297,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@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`() {
|
||||
@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)
|
||||
@ -292,7 +309,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["999"])) 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)
|
||||
|
||||
@ -306,7 +324,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["999"])) 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)
|
||||
@ -321,7 +340,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolloff, limitedValues = ["0"])) 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)
|
||||
|
||||
@ -334,7 +354,8 @@ class MotionGroup_scrolloff_Test : VimTestCase() {
|
||||
@TraceOptions(OptionConstants.scrolljump)
|
||||
class MotionGroup_scrolljump_Test : VimTestCase() {
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["0"])) 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")
|
||||
@ -343,7 +364,8 @@ class MotionGroup_scrolljump_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["1"])) 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")
|
||||
@ -352,7 +374,8 @@ class MotionGroup_scrolljump_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["10"])) 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")
|
||||
@ -361,7 +384,8 @@ class MotionGroup_scrolljump_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["0"])) 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")
|
||||
@ -370,7 +394,8 @@ class MotionGroup_scrolljump_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["1"])) 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")
|
||||
@ -379,7 +404,8 @@ class MotionGroup_scrolljump_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["10"])) 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")
|
||||
@ -388,7 +414,8 @@ class MotionGroup_scrolljump_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["-50"])) 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")
|
||||
@ -397,7 +424,8 @@ class MotionGroup_scrolljump_Test : VimTestCase() {
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.OPTION)
|
||||
@OptionTest(VimOption(OptionConstants.scrolljump, limitedValues = ["-10"])) 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")
|
||||
|
@ -21,12 +21,12 @@ 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.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.impl.TraceOptions
|
||||
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
|
||||
import org.jetbrains.plugins.ideavim.waitAndAssert
|
||||
import org.jetbrains.plugins.ideavim.waitAndAssertMode
|
||||
|
||||
|
@ -28,13 +28,13 @@ 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.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.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.jetbrains.plugins.ideavim.assertDoesntChange
|
||||
import org.jetbrains.plugins.ideavim.impl.OptionTest
|
||||
import org.jetbrains.plugins.ideavim.impl.TraceOptions
|
||||
import org.jetbrains.plugins.ideavim.impl.VimOption
|
||||
import org.jetbrains.plugins.ideavim.waitAndAssertMode
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.TestInfo
|
||||
@ -309,7 +309,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template in normal mode`() {
|
||||
@ -327,7 +327,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test save mode for insert mode`() {
|
||||
@ -346,7 +346,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test save mode for visual mode`() {
|
||||
@ -365,7 +365,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template to select in normal mode`() {
|
||||
@ -383,7 +383,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template to select in insert mode`() {
|
||||
@ -402,7 +402,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template to select in visual mode`() {
|
||||
@ -421,7 +421,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_select]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template to select in select mode`() {
|
||||
@ -440,7 +440,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template to visual in normal mode`() {
|
||||
@ -458,7 +458,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template to visual in insert mode`() {
|
||||
@ -477,7 +477,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template to visual in visual mode`() {
|
||||
@ -496,7 +496,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_visual]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template to visual in select mode`() {
|
||||
@ -515,7 +515,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template with multiple times`() {
|
||||
@ -538,7 +538,7 @@ class TemplateTest : VimTestCase() {
|
||||
}
|
||||
|
||||
@OptionTest(
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep])
|
||||
VimOption(IjOptionConstants.idearefactormode, limitedValues = [IjOptionConstants.idearefactormode_keep]),
|
||||
)
|
||||
@TestWithoutNeovim(reason = SkipNeovimReason.TEMPLATES)
|
||||
fun `test template with lookup`() {
|
||||
|
@ -12,7 +12,6 @@ import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
import org.junit.Assert
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@ -24,7 +23,7 @@ class EditorHelperTest : VimTestCase() {
|
||||
EditorHelper.scrollColumnToLeftOfScreen(fixture.editor, 0, 2)
|
||||
val visibleArea = fixture.editor.scrollingModel.visibleArea
|
||||
val columnWidth = EditorHelper.getPlainSpaceWidthFloat(fixture.editor)
|
||||
Assert.assertEquals((2 * columnWidth).roundToInt(), visibleArea.x)
|
||||
assertEquals((2 * columnWidth).roundToInt(), visibleArea.x)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@ -35,7 +34,7 @@ class EditorHelperTest : VimTestCase() {
|
||||
EditorHelper.scrollColumnToRightOfScreen(fixture.editor, 0, column)
|
||||
val visibleArea = fixture.editor.scrollingModel.visibleArea
|
||||
val columnWidth = EditorHelper.getPlainSpaceWidthFloat(fixture.editor)
|
||||
Assert.assertEquals(((column - screenWidth + 1) * columnWidth).roundToInt(), visibleArea.x)
|
||||
assertEquals(((column - screenWidth + 1) * columnWidth).roundToInt(), visibleArea.x)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@ -48,7 +47,7 @@ class EditorHelperTest : VimTestCase() {
|
||||
EditorHelper.scrollColumnToMiddleOfScreen(fixture.editor, 0, 99)
|
||||
val visibleArea = fixture.editor.scrollingModel.visibleArea
|
||||
val columnWidth = EditorHelper.getPlainSpaceWidthFloat(fixture.editor)
|
||||
Assert.assertEquals((59 * columnWidth).roundToInt(), visibleArea.x)
|
||||
assertEquals((59 * columnWidth).roundToInt(), visibleArea.x)
|
||||
}
|
||||
|
||||
@TestWithoutNeovim(SkipNeovimReason.NOT_VIM_TESTING)
|
||||
@ -62,6 +61,6 @@ class EditorHelperTest : VimTestCase() {
|
||||
EditorHelper.scrollColumnToMiddleOfScreen(fixture.editor, 0, 99)
|
||||
val visibleArea = fixture.editor.scrollingModel.visibleArea
|
||||
val columnWidth = EditorHelper.getPlainSpaceWidthFloat(fixture.editor)
|
||||
Assert.assertEquals((59 * columnWidth).roundToInt(), visibleArea.x)
|
||||
assertEquals((59 * columnWidth).roundToInt(), visibleArea.x)
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,6 @@ internal annotation class VimOption(
|
||||
val doesntAffectTest: Boolean = false,
|
||||
)
|
||||
|
||||
|
||||
// ----------- Implementation
|
||||
|
||||
private class OptionsVerificator : BeforeTestExecutionCallback, AfterTestExecutionCallback {
|
||||
@ -315,7 +314,9 @@ private class VimOptionsInvocator : TestTemplateInvocationContextProvider {
|
||||
.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 {
|
||||
fail("Cannot generate values automatically. Please specify option values explicitelly using 'limitedValues' field")
|
||||
}
|
||||
} else {
|
||||
val boundedValues = option.boundedValues
|
||||
if (boundedValues != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user