diff --git a/build.gradle.kts b/build.gradle.kts index 91fed41a34..c82392850d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -152,6 +152,8 @@ dependencies { testFixturesImplementation("org.junit.jupiter:junit-jupiter-api:5.10.3") testFixturesImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.3") testFixturesImplementation("org.junit.jupiter:junit-jupiter-params:5.10.3") + testImplementation(project(":vim-engine", "testArtifacts")) + testFixturesImplementation(project(":vim-engine", "testArtifacts")) // Temp workaround suggested in https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#junit5-test-framework-refers-to-junit4 // Can be removed when IJPL-159134 is fixed diff --git a/src/main/java/com/maddyhome/idea/vim/newapi/IjVimSearchGroup.kt b/src/main/java/com/maddyhome/idea/vim/newapi/IjVimSearchGroup.kt index c19b322494..dc0fdd615a 100644 --- a/src/main/java/com/maddyhome/idea/vim/newapi/IjVimSearchGroup.kt +++ b/src/main/java/com/maddyhome/idea/vim/newapi/IjVimSearchGroup.kt @@ -18,11 +18,8 @@ import com.intellij.openapi.editor.event.DocumentEvent import com.intellij.openapi.editor.event.DocumentListener import com.intellij.openapi.editor.markup.RangeHighlighter import com.intellij.openapi.fileEditor.FileEditorManagerEvent -import com.intellij.openapi.util.Ref import com.maddyhome.idea.vim.VimPlugin -import com.maddyhome.idea.vim.api.ExecutionContext import com.maddyhome.idea.vim.api.Options -import com.maddyhome.idea.vim.api.VimCaret import com.maddyhome.idea.vim.api.VimEditor import com.maddyhome.idea.vim.api.VimSearchGroupBase import com.maddyhome.idea.vim.api.globalOptions @@ -30,21 +27,16 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.common.Direction import com.maddyhome.idea.vim.common.Direction.Companion.fromInt import com.maddyhome.idea.vim.diagnostic.vimLogger -import com.maddyhome.idea.vim.helper.MessageHelper -import com.maddyhome.idea.vim.helper.TestInputModel.Companion.getInstance import com.maddyhome.idea.vim.helper.addSubstitutionConfirmationHighlight import com.maddyhome.idea.vim.helper.highlightSearchResults -import com.maddyhome.idea.vim.helper.isCloseKeyStroke import com.maddyhome.idea.vim.helper.shouldIgnoreCase import com.maddyhome.idea.vim.helper.updateSearchHighlights import com.maddyhome.idea.vim.helper.vimLastHighlighters import com.maddyhome.idea.vim.options.GlobalOptionChangeListener -import com.maddyhome.idea.vim.ui.ModalEntry import com.maddyhome.idea.vim.vimscript.model.functions.handlers.SubmatchFunctionHandler import org.jdom.Element import org.jetbrains.annotations.Contract import org.jetbrains.annotations.TestOnly -import javax.swing.KeyStroke @State( name = "VimSearchSettings", @@ -112,21 +104,6 @@ open class IjVimSearchGroup : VimSearchGroupBase(), PersistentStateComponent", "0", "1", Mode.NORMAL()) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/CommandCountTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/CommandCountTest.kt index 2f2af7bd69..0d18c3578f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/CommandCountTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/CommandCountTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.action import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class CommandCountTest : VimTestCase() { +class CommandCountTest : VimTestCaseBase() { @Test fun `test count operator motion`() { configureByText("${c}1234567890") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/CopyActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/CopyActionTest.kt index 30b8f16b87..380320ea5b 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/CopyActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/CopyActionTest.kt @@ -11,10 +11,11 @@ import com.intellij.idea.TestFor import com.maddyhome.idea.vim.KeyHandler import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector +import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.waitAndAssert import org.junit.jupiter.api.Test import kotlin.test.assertNotNull @@ -24,7 +25,7 @@ import kotlin.test.assertTrue * @author vlan */ @Suppress("SpellCheckingInspection") -class CopyActionTest : VimTestCase() { +class CopyActionTest : VimTestCaseBase() { // |y| |p| |count| @Test fun testYankPutCharacters() { @@ -184,7 +185,7 @@ class CopyActionTest : VimTestCase() { """.trimIndent(), ) - kotlin.test.assertEquals(0, editor.caretModel.offset) + kotlin.test.assertEquals(0, editor.ij.caretModel.offset) } // VIM-632 |CTRL-V| |v_y| |p| diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/EscapeTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/EscapeTest.kt index c64aff109a..bdcfa419d6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/EscapeTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/EscapeTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.action import com.intellij.idea.TestFor import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class EscapeTest : VimTestCase() { +class EscapeTest : VimTestCaseBase() { @Test @TestFor(issues = ["VIM-3190"]) @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/FileGetLocationInfoActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/FileGetLocationInfoActionTest.kt index 4860a416ae..dac4718cb7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/FileGetLocationInfoActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/FileGetLocationInfoActionTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.action import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class FileGetLocationInfoActionTest : VimTestCase() { +class FileGetLocationInfoActionTest : VimTestCaseBase() { @VimBehaviorDiffers(originalVimAfter = "Col 1 of 11; Line 1 of 6; Word 1 of 32; Byte 1 of 166") @Test fun `test get file info`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/GuardedBlocksTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/GuardedBlocksTest.kt index d479be7645..c6e7f821a0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/GuardedBlocksTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/GuardedBlocksTest.kt @@ -12,12 +12,12 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow -class GuardedBlocksTest : VimTestCase() { +class GuardedBlocksTest : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.GUARDED_BLOCKS) @Test fun `test delete char with block`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/MacroActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/MacroActionTest.kt index 35254e555a..28060e0630 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/MacroActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/MacroActionTest.kt @@ -18,7 +18,7 @@ import org.jetbrains.plugins.ideavim.ExceptionHandler import org.jetbrains.plugins.ideavim.OnlyThrowLoggedErrorProcessor import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.exceptionMappingOwner import org.jetbrains.plugins.ideavim.rangeOf import org.jetbrains.plugins.ideavim.waitAndAssert @@ -32,7 +32,7 @@ import kotlin.test.assertTrue /** * @author vlan */ -class MacroActionTest : VimTestCase() { +class MacroActionTest : VimTestCaseBase() { @AfterEach fun tearDown() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/MacroWithEditingTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/MacroWithEditingTest.kt index 2abe8a1ece..02b7aa6f04 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/MacroWithEditingTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/MacroWithEditingTest.kt @@ -12,11 +12,11 @@ import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.waitAndAssert import org.junit.jupiter.api.Test -class MacroWithEditingTest : VimTestCase() { +class MacroWithEditingTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test fun `test print macro`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/MarkTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/MarkTest.kt index a838488a02..087b841bea 100755 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/MarkTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/MarkTest.kt @@ -14,12 +14,12 @@ import com.maddyhome.idea.vim.newapi.IjVimEditor import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertNotNull @Suppress("SpellCheckingInspection") -class MarkTest : VimTestCase() { +class MarkTest : VimTestCaseBase() { // |m| @Test fun testLocalMark() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/MotionActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/MotionActionTest.kt index b7ac887968..b6e31e16e4 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/MotionActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/MotionActionTest.kt @@ -15,14 +15,14 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test /** * @author vlan */ -class MotionActionTest : VimTestCase() { +class MotionActionTest : VimTestCaseBase() { @Test fun testDoubleToggleVisual() { val contents = "one tw${c}o\n" @@ -382,7 +382,7 @@ class MotionActionTest : VimTestCase() { // VIM-1287 |d| |v_i{| @Test @VimBehaviorDiffers( - originalVimAfter = "{\"{foo, ${c}bar\", baz}}", + originalVimAfter = "{\"{foo, bar\", baz}}", description = "We have PSI and can resolve this case correctly. I'm not sure if it should be fixed" ) fun testBadlyNestedBlockInsideString() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/MultipleCaretsTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/MultipleCaretsTest.kt index 52118a1ee6..7f2d35c206 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/MultipleCaretsTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/MultipleCaretsTest.kt @@ -13,17 +13,18 @@ import com.maddyhome.idea.vim.action.motion.search.SearchWholeWordForwardAction import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.common.TextRange import com.maddyhome.idea.vim.newapi.IjVimEditor +import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertNotNull /** * @author Vasily Alferov */ -class MultipleCaretsTest : VimTestCase() { +class MultipleCaretsTest : VimTestCaseBase() { // com.maddyhome.idea.vim.action.visual.leftright @Test fun testMotionLeftAction() { @@ -40,7 +41,7 @@ class MultipleCaretsTest : VimTestCase() { @Test fun testMovementMerging() { val editor = typeTextInFile(injector.parser.parseKeys("2h"), "o${c}n${c}e") - kotlin.test.assertEquals(1, editor.caretModel.caretCount) + kotlin.test.assertEquals(1, editor.ij.caretModel.caretCount) assertState("${c}one") } @@ -1842,7 +1843,7 @@ $c five six se${c}ven eight ) } - @VimBehaviorDiffers(originalVimAfter = "${c}\n${c}\nabcde\n${c}\n${c}\nabcde\n") + @VimBehaviorDiffers(originalVimAfter = "\n\nabcde\n\n\nabcde\n") @Test fun testInsertNewLineAboveActionWithMultipleCaretsInLine() { typeTextInFile( @@ -2173,7 +2174,7 @@ rtyfg${c}hzxc""" val editor = configureByText(before) injector.registerGroup.storeText('*', "fgh") VimPlugin.getRegister() - .storeText(IjVimEditor(editor), editor.vim.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) + .storeText(editor, editor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("\"*P")) val after = "fg${c}hqfg${c}hwe asd zxc rty fg${c}hfgh vbn" assertState(after) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/RedrawActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/RedrawActionTest.kt index d7424b7f53..32f418486f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/RedrawActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/RedrawActionTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.action -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class RedrawActionTest : VimTestCase() { +class RedrawActionTest : VimTestCaseBase() { @Test fun `test redraw action clears status line`() { configureByText("lorem ipsum") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/RepeatActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/RepeatActionTest.kt index e677814a70..2af1913360 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/RepeatActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/RepeatActionTest.kt @@ -14,11 +14,11 @@ import com.maddyhome.idea.vim.command.MappingMode import com.maddyhome.idea.vim.key.MappingOwner import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class RepeatActionTest : VimTestCase() { +class RepeatActionTest : VimTestCaseBase() { @Test fun testSimpleRepeatLastCommand() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/ResetModeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/ResetModeActionTest.kt index 391a66868c..cec5f236cc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/ResetModeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/ResetModeActionTest.kt @@ -15,10 +15,10 @@ import com.maddyhome.idea.vim.key.MappingOwner import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ResetModeActionTest : VimTestCase() { +class ResetModeActionTest : VimTestCaseBase() { private val owner = MappingOwner.Plugin.get("ResetModeActionTest") @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/SpecialRegistersTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/SpecialRegistersTest.kt index 18614d0f9e..4ae718bf57 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/SpecialRegistersTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/SpecialRegistersTest.kt @@ -12,14 +12,14 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.register.RegisterConstants.LAST_INSERTED_TEXT_REGISTER 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.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo import kotlin.test.assertNotEquals import kotlin.test.assertNotNull -class SpecialRegistersTest : VimTestCase() { +class SpecialRegistersTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/OperatorActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/OperatorActionTest.kt index e9bebf1be9..bf817f006a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/OperatorActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/OperatorActionTest.kt @@ -8,11 +8,11 @@ package org.jetbrains.plugins.ideavim.action.change -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class OperatorActionTest : VimTestCase() { +class OperatorActionTest : VimTestCaseBase() { @Test fun `test operator action throws error if operatorfunc is empty`() { doTest("g@w", "lorem ipsum", "lorem ipsum") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/RepeatChangeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/RepeatChangeActionTest.kt index e2b8bc09b4..ae6a0bae49 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/RepeatChangeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/RepeatChangeActionTest.kt @@ -13,10 +13,10 @@ import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class RepeatChangeActionTest : VimTestCase() { +class RepeatChangeActionTest : VimTestCaseBase() { @Test fun `test simple repeat`() { val keys = listOf("v2erXj^", ".") @@ -248,7 +248,7 @@ class RepeatChangeActionTest : VimTestCase() { XXXXXnd it in a legendary land XXXXXocks and lavender and tufted grass, XXXXX it was settled on some sodden sand - hard ${c}XXXXXe torrent of a mountain pass. + hard XXXXXe torrent of a mountain pass. """, ) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/UndoActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/UndoActionTest.kt index 28daf1b9a6..e493a247f7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/UndoActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/UndoActionTest.kt @@ -12,11 +12,11 @@ import com.intellij.idea.TestFor import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.newapi.globalIjOptions import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assumptions.assumeTrue import org.junit.jupiter.api.Test -class UndoActionTest : VimTestCase() { +class UndoActionTest : VimTestCaseBase() { @Test fun `test simple undo`() { val keys = listOf("dw", "u") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeCaseToggleCharacterActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeCaseToggleCharacterActionTest.kt index 3ad46bc68b..197818d193 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeCaseToggleCharacterActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeCaseToggleCharacterActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.change.change import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ChangeCaseToggleCharacterActionTest : VimTestCase() { +class ChangeCaseToggleCharacterActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @Test fun `test whichwrap in the same line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeLineActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeLineActionTest.kt index 9a55c65114..baa6690529 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeLineActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeLineActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.change.change import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ChangeLineActionTest : VimTestCase() { +class ChangeLineActionTest : VimTestCaseBase() { @Test fun `test on empty file`() { setupChecks { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeMotionActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeMotionActionTest.kt index c7ac2ca781..99cae7b88d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeMotionActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeMotionActionTest.kt @@ -11,11 +11,11 @@ package org.jetbrains.plugins.ideavim.action.change.change import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class ChangeMotionActionTest : VimTestCase() { +class ChangeMotionActionTest : VimTestCaseBase() { // VIM-515 |c| |W| @Test fun `test change big word with punctuation and alpha`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeVisualActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeVisualActionTest.kt index b87808e0a3..ab944274af 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeVisualActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeVisualActionTest.kt @@ -13,10 +13,10 @@ package org.jetbrains.plugins.ideavim.action.change.change import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ChangeVisualActionTest : VimTestCase() { +class ChangeVisualActionTest : VimTestCaseBase() { @Test fun `test multiple line change`() { val keys = "VjcHello" @@ -66,7 +66,7 @@ class ChangeVisualActionTest : VimTestCase() { Lorem ipsum dolor sit amet, consectetur adipiscing elit - ${c} + """, ) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeVisualLinesEndActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeVisualLinesEndActionTest.kt index 97f9e312a0..5e573f45c9 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeVisualLinesEndActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/ChangeVisualLinesEndActionTest.kt @@ -12,10 +12,10 @@ package org.jetbrains.plugins.ideavim.action.change.change import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ChangeVisualLinesEndActionTest : VimTestCase() { +class ChangeVisualLinesEndActionTest : VimTestCaseBase() { @Test fun `test change last line`() { val keys = "VC" @@ -69,7 +69,7 @@ class ChangeVisualLinesEndActionTest : VimTestCase() { Lorem ipsum dolor sit amet, consectetur adipiscing elit Sed in orci mauris. - ${c} + """, ) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/InsertRegisterTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/InsertRegisterTest.kt index 0867b74ab1..984ac29784 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/InsertRegisterTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/InsertRegisterTest.kt @@ -9,11 +9,11 @@ package org.jetbrains.plugins.ideavim.action.change.change import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class InsertRegisterTest : VimTestCase() { +class InsertRegisterTest : VimTestCaseBase() { // todo test cursor position VIM-2732 @Test @Disabled diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeNumberDecActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeNumberDecActionTest.kt index 9c5b7b9d5a..de219a9d8d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeNumberDecActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeNumberDecActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.change.change.number import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ChangeNumberDecActionTest : VimTestCase() { +class ChangeNumberDecActionTest : VimTestCaseBase() { @Test fun `test decrement hex to negative value`() { doTest("", "0x0000", "0xffffffffffffffff", Mode.NORMAL()) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeNumberIncActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeNumberIncActionTest.kt index 8101155be9..1f7529171a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeNumberIncActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeNumberIncActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.change.change.number import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ChangeNumberIncActionTest : VimTestCase() { +class ChangeNumberIncActionTest : VimTestCaseBase() { @VimBehaviorDiffers(originalVimAfter = "11X0") @Test fun `test inc fancy number`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberAvalancheDecActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberAvalancheDecActionTest.kt index 93d5252975..470c0c11d9 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberAvalancheDecActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberAvalancheDecActionTest.kt @@ -9,13 +9,13 @@ package org.jetbrains.plugins.ideavim.action.change.change.number import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class ChangeVisualNumberAvalancheDecActionTest : VimTestCase() { +class ChangeVisualNumberAvalancheDecActionTest : VimTestCaseBase() { @Test fun `test dec visual avalanche`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberAvalancheIncActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberAvalancheIncActionTest.kt index 071a9f4d07..30a748e70c 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberAvalancheIncActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberAvalancheIncActionTest.kt @@ -9,13 +9,13 @@ package org.jetbrains.plugins.ideavim.action.change.change.number import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class ChangeVisualNumberAvalancheIncActionTest : VimTestCase() { +class ChangeVisualNumberAvalancheIncActionTest : VimTestCaseBase() { @Test fun `test inc visual avalanche`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberDecActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberDecActionTest.kt index f4bc38db17..d80ee187a5 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberDecActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberDecActionTest.kt @@ -10,13 +10,13 @@ package org.jetbrains.plugins.ideavim.action.change.change.number import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class ChangeVisualNumberDecActionTest : VimTestCase() { +class ChangeVisualNumberDecActionTest : VimTestCaseBase() { @Test fun `test dec visual full number`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberIncActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberIncActionTest.kt index c8f565bd20..f1789f0dfc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberIncActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/change/number/ChangeVisualNumberIncActionTest.kt @@ -10,13 +10,13 @@ package org.jetbrains.plugins.ideavim.action.change.change.number import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class ChangeVisualNumberIncActionTest : VimTestCase() { +class ChangeVisualNumberIncActionTest : VimTestCaseBase() { @Test fun `test inc visual full number`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteCharacterLeftActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteCharacterLeftActionTest.kt index bcb1ea3f5a..f477d4ac13 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteCharacterLeftActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteCharacterLeftActionTest.kt @@ -8,11 +8,11 @@ package org.jetbrains.plugins.ideavim.action.change.delete -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test // |X| -class DeleteCharacterLeftActionTest : VimTestCase() { +class DeleteCharacterLeftActionTest : VimTestCaseBase() { @Test fun `test delete single character`() { val keys = "X" diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteCharacterRightActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteCharacterRightActionTest.kt index 7d45721933..3c0c7d1a22 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteCharacterRightActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteCharacterRightActionTest.kt @@ -9,11 +9,11 @@ package org.jetbrains.plugins.ideavim.action.change.delete import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test // |x| -class DeleteCharacterRightActionTest : VimTestCase() { +class DeleteCharacterRightActionTest : VimTestCaseBase() { @Test fun `test delete single character`() { val keys = injector.parser.parseKeys("x") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteEndOfLineActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteEndOfLineActionTest.kt index 4515d38515..2e711fad9a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteEndOfLineActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteEndOfLineActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.change.delete import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class DeleteEndOfLineActionTest : VimTestCase() { +class DeleteEndOfLineActionTest : VimTestCaseBase() { @Test fun `test delete on empty line`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteJoinLinesSpacesActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteJoinLinesSpacesActionTest.kt index 7bafb2cf0c..2f4ffb9fdc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteJoinLinesSpacesActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteJoinLinesSpacesActionTest.kt @@ -12,13 +12,13 @@ import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestIjOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase 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() { +class DeleteJoinLinesSpacesActionTest : VimTestCaseBase() { @OptionTest(VimOption(TestIjOptionConstants.ideajoin)) fun `test join with idea`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteJoinVisualLinesSpacesActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteJoinVisualLinesSpacesActionTest.kt index d9ffc4636e..db51146310 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteJoinVisualLinesSpacesActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteJoinVisualLinesSpacesActionTest.kt @@ -12,13 +12,13 @@ import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestIjOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase 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() { +class DeleteJoinVisualLinesSpacesActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest(VimOption(TestIjOptionConstants.ideajoin, limitedValues = ["true"])) fun `test join via idea`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteMotionActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteMotionActionTest.kt index 4eece08068..9c46f5da36 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteMotionActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteMotionActionTest.kt @@ -14,7 +14,7 @@ import com.maddyhome.idea.vim.VimPlugin import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.Arguments @@ -22,7 +22,7 @@ import org.junit.jupiter.params.provider.Arguments.arguments import org.junit.jupiter.params.provider.MethodSource import java.util.stream.Stream -class DeleteMotionActionTest : VimTestCase() { +class DeleteMotionActionTest : VimTestCaseBase() { @Test fun `test delete last line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualActionTest.kt index 98fc5c9d84..fd22186b81 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualActionTest.kt @@ -14,7 +14,7 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.waitAndAssertMode import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class DeleteVisualActionTest : VimTestCase() { +class DeleteVisualActionTest : VimTestCaseBase() { @Test fun `test delete block SE direction`() { val keys = listOf("e2j", "d") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesActionTest.kt deleted file mode 100644 index 6e62eeb077..0000000000 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesActionTest.kt +++ /dev/null @@ -1,139 +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. - */ - -@file:Suppress("RemoveCurlyBracesFromTemplate") - -package org.jetbrains.plugins.ideavim.action.change.delete - -import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase -import org.junit.jupiter.api.Test - -class DeleteVisualLinesActionTest : VimTestCase() { - @Test - fun `test remove line in char visual mode`() { - doTest( - "vlllX", - """ - I found ${c}it in a legendary land - consectetur adipiscing elit - Sed in orci mauris. - Cras id tellus in ex imperdiet egestas. - """.trimIndent(), - """ - ${c}consectetur adipiscing elit - Sed in orci mauris. - Cras id tellus in ex imperdiet egestas. - """.trimIndent(), - Mode.NORMAL(), - ) - } - - @Test - fun `test remove line in char visual mode last line`() { - doTest( - "vlllX", - """ - Lorem ipsum dolor sit amet, - consectetur adipiscing elit - Sed in orci mauris. - hard by ${c}the torrent of a mountain pass. - """.trimIndent(), - """ - Lorem ipsum dolor sit amet, - consectetur adipiscing elit - ${c}Sed in orci mauris. - """.trimIndent(), - Mode.NORMAL(), - ) - } - - @Test - fun `test remove line in line visual mode`() { - doTest( - "VX", - """ - I found ${c}it in a legendary land - consectetur adipiscing elit - Sed in orci mauris. - Cras id tellus in ex imperdiet egestas. - """.trimIndent(), - """ - ${c}consectetur adipiscing elit - Sed in orci mauris. - Cras id tellus in ex imperdiet egestas. - """.trimIndent(), - Mode.NORMAL(), - ) - } - - @Test - fun `test remove line in line visual mode line end`() { - doTest( - "VX", - """ - Lorem ipsum dolor sit amet, - consectetur adipiscing elit - Sed in orci mauris. - hard by ${c}the torrent of a mountain pass. - """.trimIndent(), - """ - Lorem ipsum dolor sit amet, - consectetur adipiscing elit - ${c}Sed in orci mauris. - """.trimIndent(), - Mode.NORMAL(), - ) - } - - @Test - fun `test multiple line delete till the end`() { - val keys = "Vjd" - val before = """ - Lorem Ipsum - - Lorem ipsum dolor sit amet, - consectetur adipiscing elit - - ${c}Sed in orci mauris. - Cras id tellus in ex imperdiet egestas. - """.trimIndent() - val after = """ - Lorem Ipsum - - Lorem ipsum dolor sit amet, - consectetur adipiscing elit - ${c} - """.trimIndent() - doTest(keys, before, after, Mode.NORMAL()) - } - - @Test - fun `test multiple line delete till the end with a new line`() { - val keys = "Vjd" - val before = """ - Lorem Ipsum - - Lorem ipsum dolor sit amet, - consectetur adipiscing elit - - ${c}Sed in orci mauris. - Cras id tellus in ex imperdiet egestas. - - """.trimIndent() - val after = """ - Lorem Ipsum - - Lorem ipsum dolor sit amet, - consectetur adipiscing elit - - ${c} - """.trimIndent() - doTest(keys, before, after, Mode.NORMAL()) - } -} diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesActionTestImpl.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesActionTestImpl.kt new file mode 100644 index 0000000000..89b2dd2a96 --- /dev/null +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesActionTestImpl.kt @@ -0,0 +1,16 @@ +/* + * 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. + */ + +@file:Suppress("RemoveCurlyBracesFromTemplate") + +package org.jetbrains.plugins.ideavim.action.change.delete + +import com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesActionTest +import org.jetbrains.plugins.ideavim.VimTestCaseBase + +class DeleteVisualLinesActionTestImpl : DeleteVisualLinesActionTest, VimTestCaseBase() diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesEndActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesEndActionTest.kt index c73bab032e..a6d24c421d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesEndActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/DeleteVisualLinesEndActionTest.kt @@ -15,13 +15,13 @@ import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.virtualedit) -class DeleteVisualLinesEndActionTest : VimTestCase() { +class DeleteVisualLinesEndActionTest : VimTestCaseBase() { @OptionTest(VimOption(TestOptionConstants.virtualedit)) fun `test simple deletion`() { val keys = listOf("v", "D") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/JoinNotificationTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/JoinNotificationTest.kt index 6504b006da..04012c7582 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/JoinNotificationTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/delete/JoinNotificationTest.kt @@ -16,7 +16,7 @@ import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.group.NotificationService import org.jetbrains.plugins.ideavim.TestIjOptionConstants -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @@ -26,7 +26,7 @@ import kotlin.test.assertTrue * @author Alex Plate */ @TraceOptions(TestIjOptionConstants.ideajoin) -class JoinNotificationTest : VimTestCase() { +class JoinNotificationTest : VimTestCaseBase() { @OptionTest(VimOption(TestIjOptionConstants.ideajoin, limitedValues = ["false"])) fun `test notification shown for no ideajoin`() { val notification = newNotifications { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertAfterCursorActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertAfterCursorActionTest.kt index 574096ee26..380eb71283 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertAfterCursorActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertAfterCursorActionTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertAfterCursorActionTest : VimTestCase() { +class InsertAfterCursorActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.INLAYS) @Test fun `test insert after cursor with inlay with preceding text places caret between inlay and preceding text`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertAfterLineEndActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertAfterLineEndActionTest.kt index 2e3074d84a..610e5a50fa 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertAfterLineEndActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertAfterLineEndActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertAfterLineEndActionTest : VimTestCase() { +class InsertAfterLineEndActionTest : VimTestCaseBase() { @Test fun `test insert after line end action`() { typeTextInFile( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBackspaceActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBackspaceActionTest.kt index f0bfa194f6..341e2986d0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBackspaceActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBackspaceActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertBackspaceActionTest : VimTestCase() { +class InsertBackspaceActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test fun `test insert backspace`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBeforeCursorActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBeforeCursorActionTest.kt index d7fc1a14e5..c8e58b107a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBeforeCursorActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBeforeCursorActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertBeforeCursorActionTest : VimTestCase() { +class InsertBeforeCursorActionTest : VimTestCaseBase() { @Test fun `test check caret shape`() { doTest("i", "123", "123", Mode.INSERT) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBeforeFirstNonBlankActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBeforeFirstNonBlankActionTest.kt index 616bb22bd1..8deed02ace 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBeforeFirstNonBlankActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertBeforeFirstNonBlankActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertBeforeFirstNonBlankActionTest : VimTestCase() { +class InsertBeforeFirstNonBlankActionTest : VimTestCaseBase() { @Test fun `test insert multiple carets`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertCompletedLiteralActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertCompletedLiteralActionTest.kt index e5da1460bd..06a6e04940 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertCompletedLiteralActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertCompletedLiteralActionTest.kt @@ -11,11 +11,11 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class InsertCompletedLiteralActionTest : VimTestCase() { +class InsertCompletedLiteralActionTest : VimTestCaseBase() { companion object { @JvmStatic diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteActionTestImpl.kt similarity index 50% rename from src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteActionTest.kt rename to src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteActionTestImpl.kt index 4688097b64..a695450650 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteActionTestImpl.kt @@ -1,5 +1,5 @@ /* - * Copyright 2003-2023 The IdeaVim authors + * Copyright 2003-2024 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 @@ -8,22 +8,16 @@ package org.jetbrains.plugins.ideavim.action.change.insert -import com.maddyhome.idea.vim.api.injector +import com.maddyhome.idea.vim.action.change.insert.InsertDeleteActionTest import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertDeleteActionTest : VimTestCase() { +class InsertDeleteActionTestImpl : InsertDeleteActionTest, VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test - fun `test insert delete`() { - val before = "I fo${c}und it in a legendary land" - val after = "I fo${c}nd it in a legendary land" - configureByText(before) - - typeText(injector.parser.parseKeys("i" + "")) - - assertState(after) + override fun `test insert delete`() { + super.`test insert delete`() } -} +} \ No newline at end of file diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteInsertedTextActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteInsertedTextActionTest.kt index 546373e2b8..98566f5576 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteInsertedTextActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeleteInsertedTextActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertDeleteInsertedTextActionTest : VimTestCase() { +class InsertDeleteInsertedTextActionTest : VimTestCaseBase() { // VIM-1655 @Test fun `test deleted text is not yanked`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeletePreviousWordActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeletePreviousWordActionTest.kt index daa9e299f4..1250bd3970 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeletePreviousWordActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertDeletePreviousWordActionTest.kt @@ -13,10 +13,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertDeletePreviousWordActionTest : VimTestCase() { +class InsertDeletePreviousWordActionTest : VimTestCaseBase() { // VIM-1655 @Test fun `test deleted word is not yanked`() { @@ -82,7 +82,7 @@ Mode.INSERT, if (it) { legendary } - ${c} + """, ) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertEnterActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertEnterActionTest.kt index 4cbc5c07ad..73c5a36b5f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertEnterActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertEnterActionTest.kt @@ -21,12 +21,12 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.RepeatedTest import org.junit.jupiter.api.RepetitionInfo -class InsertEnterActionTest : VimTestCase() { +class InsertEnterActionTest : VimTestCaseBase() { @BeforeEach fun setUp(repetitionInfo: RepetitionInfo) { // Set up a different combination of handlers for enter action diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertExitModeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertExitModeActionTest.kt index c672e957b1..e58b6cc3b7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertExitModeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertExitModeActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertExitModeActionTest : VimTestCase() { +class InsertExitModeActionTest : VimTestCaseBase() { @Test fun `test exit visual mode`() { doTest("i", "12${c}3", "1${c}23", Mode.NORMAL()) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertNewLineAboveActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertNewLineAboveActionTest.kt index f76e60ec11..62a0442a92 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertNewLineAboveActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertNewLineAboveActionTest.kt @@ -14,12 +14,12 @@ import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class InsertNewLineAboveActionTest : VimTestCase() { +class InsertNewLineAboveActionTest : VimTestCaseBase() { @Test fun `test insert new line above`() { val before = """Lorem ipsum dolor sit amet, diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertNewLineBelowActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertNewLineBelowActionTest.kt index f0dbbff7b5..4652a6c4a8 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertNewLineBelowActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertNewLineBelowActionTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertNewLineBelowActionTest : VimTestCase() { +class InsertNewLineBelowActionTest : VimTestCaseBase() { @Test fun `test insert new line below`() { val before = """I found it in a legendary land diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertSingleCommandActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertSingleCommandActionTest.kt index 818bd6649d..77ba4e1018 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertSingleCommandActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertSingleCommandActionTest.kt @@ -9,7 +9,7 @@ package org.jetbrains.plugins.ideavim.action.change.insert import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test class InsertSingleCommandActionTest : SingleCommandActionTest() { @@ -22,7 +22,7 @@ class ReplaceSingleCommandActionTest : SingleCommandActionTest() { override val mode: Mode = Mode.REPLACE } -abstract class SingleCommandActionTest : VimTestCase() { +abstract class SingleCommandActionTest : VimTestCaseBase() { abstract val command: String abstract val mode: Mode diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertTabActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertTabActionTest.kt index 2b34227df7..e10961e964 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertTabActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/InsertTabActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.change.insert import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class InsertTabActionTest : VimTestCase() { +class InsertTabActionTest : VimTestCaseBase() { @Test fun `test insert tab`() { setupChecks { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/VisualBlockAppendActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/VisualBlockAppendActionTest.kt index 31e4f5a33c..e6850fd8d0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/VisualBlockAppendActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/VisualBlockAppendActionTest.kt @@ -12,10 +12,10 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class VisualBlockAppendActionTest : VimTestCase() { +class VisualBlockAppendActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test fun `test visual block append`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/VisualBlockInsertActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/VisualBlockInsertActionTest.kt index 342529075a..04f0f48cb4 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/VisualBlockInsertActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/insert/VisualBlockInsertActionTest.kt @@ -13,10 +13,10 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class VisualBlockInsertActionTest : VimTestCase() { +class VisualBlockInsertActionTest : VimTestCaseBase() { // VIM-1379 |CTRL-V| |j| |v_b_I| @TestWithoutNeovim(SkipNeovimReason.VISUAL_BLOCK_MODE) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/shift/ShiftLeftTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/shift/ShiftLeftTest.kt index 4f2c5c7d11..7d35e880d0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/shift/ShiftLeftTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/shift/ShiftLeftTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.change.shift import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ShiftLeftTest : VimTestCase() { +class ShiftLeftTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test fun `test shift till new line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/change/shift/ShiftRightTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/change/shift/ShiftRightTest.kt index 0f38eb63e5..dcd0bfae02 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/change/shift/ShiftRightTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/change/shift/ShiftRightTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.change.shift import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ShiftRightTest : VimTestCase() { +class ShiftRightTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.TABS) @Test fun `test shift till new line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/IdeaPutNotificationsTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/IdeaPutNotificationsTest.kt index 09bba44571..e82a5eda68 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/IdeaPutNotificationsTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/IdeaPutNotificationsTest.kt @@ -18,14 +18,14 @@ import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.options.OptionConstants import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.TestOptionConstants -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase 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.rangeOf @TraceOptions(TestOptionConstants.clipboard) -class IdeaPutNotificationsTest : VimTestCase() { +class IdeaPutNotificationsTest : VimTestCaseBase() { @OptionTest(VimOption(TestOptionConstants.clipboard, limitedValues = [""])) fun `test notification exists if no ideaput`() { val before = "${c}I found it in a legendary land" diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutTestAfterCursorActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutTestAfterCursorActionTest.kt index b07a23e85f..5fde02cb10 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutTestAfterCursorActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutTestAfterCursorActionTest.kt @@ -18,17 +18,18 @@ import com.intellij.testFramework.ExtensionTestUtil import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.globalOptions import com.maddyhome.idea.vim.api.injector +import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.options.OptionConstants import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.rangeOf import org.junit.jupiter.api.Test import java.awt.datatransfer.Transferable -class PutTestAfterCursorActionTest : VimTestCase() { +class PutTestAfterCursorActionTest : VimTestCaseBase() { @Test fun `test platform handlers are called`() { injector.globalOptions().clipboard.prependValue(OptionConstants.clipboard_ideaput) @@ -72,7 +73,7 @@ class PutTestAfterCursorActionTest : VimTestCase() { I found it in a legendary land all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}A Discovery + A Discovery """, ) @Test @@ -86,9 +87,8 @@ class PutTestAfterCursorActionTest : VimTestCase() { hard by the ${c}torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim VimPlugin.getRegister() - .storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + .storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("p")) val after = """ A Discovery @@ -106,7 +106,7 @@ class PutTestAfterCursorActionTest : VimTestCase() { @VimBehaviorDiffers( originalVimAfter = """ A Discovery - ${c}I found it in a legendary land + I found it in a legendary land GUARD I found it in a legendary land all rocks and lavender and tufted grass, @@ -120,7 +120,7 @@ class PutTestAfterCursorActionTest : VimTestCase() { I found it in a legendary land all rocks and lavender and tufted grass, """.trimIndent() - val editor = configureByText(before) + val editor = configureByText(before).ij // Add Guard to simulate Notebook behaviour. See (VIM-2577) val guardRange = before rangeOf "\nGUARD\n" editor.document.createGuardedBlock(guardRange.startOffset, guardRange.endOffset) @@ -155,9 +155,8 @@ class PutTestAfterCursorActionTest : VimTestCase() { ${c}hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim VimPlugin.getRegister() - .storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) + .storeText(editor, editor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("vep")) val after = """ A Discovery diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutTextBeforeCursorActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutTextBeforeCursorActionTest.kt index 99a14b6119..95f8c319c6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutTextBeforeCursorActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutTextBeforeCursorActionTest.kt @@ -11,11 +11,11 @@ package org.jetbrains.plugins.ideavim.action.copy import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.state.mode.SelectionType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.rangeOf import org.junit.jupiter.api.Test -class PutTextBeforeCursorActionTest : VimTestCase() { +class PutTextBeforeCursorActionTest : VimTestCaseBase() { /** * @author Oskar Persson */ @@ -30,8 +30,7 @@ class PutTextBeforeCursorActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - injector.registerGroup.storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) + injector.registerGroup.storeText(editor, editor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("V" + "P")) typeText(injector.parser.parseKeys("V" + "P")) val after = """ diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutViaIdeaTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutViaIdeaTest.kt index 27a0f3b6c4..899c57b395 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutViaIdeaTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutViaIdeaTest.kt @@ -19,7 +19,7 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.annotations.TestWithoutPrimaryClipboard import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions @@ -32,7 +32,7 @@ import java.util.* * @author Alex Plate */ @TraceOptions(TestOptionConstants.clipboard) -class PutViaIdeaTest : VimTestCase() { +class PutViaIdeaTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @OptionTest(VimOption(TestOptionConstants.clipboard, limitedValues = [OptionConstants.clipboard_ideaput])) fun `test simple insert via idea`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutVisualTextActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutVisualTextActionTest.kt index 9172e6d42b..a91c998ca2 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutVisualTextActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutVisualTextActionTest.kt @@ -12,12 +12,12 @@ package org.jetbrains.plugins.ideavim.action.copy import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector -import com.maddyhome.idea.vim.newapi.vim +import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.annotations.TestWithoutPrimaryClipboard import org.jetbrains.plugins.ideavim.rangeOf import org.junit.jupiter.api.Test @@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test * e h --||------------------ * d b || 7 | 8 | 9 | */ -class PutVisualTextActionTest : VimTestCase() { +class PutVisualTextActionTest : VimTestCaseBase() { // ----- Case 1: Copied | Characterwise | --- pasted | Characterwise | ---| small p |-------------------- @@ -74,8 +74,7 @@ class PutVisualTextActionTest : VimTestCase() { fun `test put visual text`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "legendary", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "legendary", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("ve" + "p")) val after = "legendar${c}y it in a legendary land" assertState(after) @@ -86,8 +85,7 @@ class PutVisualTextActionTest : VimTestCase() { fun `test put visual text twice`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "legendary", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "legendary", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("v2e" + "2p")) val after = "legendarylegendar${c}y in a legendary land" assertState(after) @@ -98,8 +96,7 @@ class PutVisualTextActionTest : VimTestCase() { fun `test put visual text full line`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "legendary", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "legendary", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("v$" + "2p")) val after = "legendarylegendar${c}y" assertState(after) @@ -132,8 +129,7 @@ class PutVisualTextActionTest : VimTestCase() { fun `test put visual text another direction`() { val before = "I foun${c}d it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "legendary", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "legendary", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("vb" + "p")) val after = "I legendar${c}y it in a legendary land" assertState(after) @@ -153,8 +149,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("ve" + "p")) val after = """ A Discovery @@ -181,8 +176,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("ve" + "p")) val after = """ A Discovery @@ -209,8 +203,7 @@ class PutVisualTextActionTest : VimTestCase() { ${c}hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("ve" + "p")) val after = """ A Discovery @@ -237,8 +230,7 @@ class PutVisualTextActionTest : VimTestCase() { ${c}hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("v$" + "p")) val after = """ A Discovery @@ -454,8 +446,7 @@ class PutVisualTextActionTest : VimTestCase() { the dingy underside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("ve" + "p")) val after = """ A Discovery @@ -490,8 +481,7 @@ class PutVisualTextActionTest : VimTestCase() { the dingy ${c}underside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("ve" + "p")) val after = """ A Discovery @@ -528,8 +518,7 @@ class PutVisualTextActionTest : VimTestCase() { the dingy ${c}underside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("ve" + "2p")) val after = """ A Discovery @@ -639,8 +628,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("V" + "p")) val after = """ A Discovery @@ -665,8 +653,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("V" + "2p")) val after = """ A Discovery @@ -687,7 +674,7 @@ class PutVisualTextActionTest : VimTestCase() { I found it in a legendary land all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}Discovery + Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -702,8 +689,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by ${c}the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("V" + "p")) val after = """ A Discovery @@ -721,10 +707,10 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - ${c}Discovery + Discovery all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}Discovery + Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -757,10 +743,10 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - ${c}Discovery + Discovery all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}Discovery + Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -793,10 +779,10 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - ${c}Discovery + Discovery all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}Discovery + Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -829,10 +815,10 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - ${c}Discovery + Discovery all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}Discovery + Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -875,8 +861,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("V" + "p")) val after = """ A Discovery @@ -901,8 +886,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("V" + "2p")) val after = """ A Discovery @@ -923,7 +907,7 @@ class PutVisualTextActionTest : VimTestCase() { I found it in a legendary land all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}A Discovery + A Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -938,8 +922,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the ${c}torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("V" + "p")) val after = """ A Discovery @@ -957,10 +940,10 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - ${c}A Discovery + A Discovery all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}A Discovery + A Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -993,10 +976,10 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - ${c}A Discovery + A Discovery all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}A Discovery + A Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -1029,10 +1012,10 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - ${c}A Discovery + A Discovery all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}A Discovery + A Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -1065,10 +1048,10 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - ${c}A Discovery + A Discovery all rocks and lavender and tufted grass, where it was settled on some sodden sand - ${c}A Discovery + A Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -1116,8 +1099,7 @@ class PutVisualTextActionTest : VimTestCase() { the dingy underside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("V" + "p")) val after = """ A Discovery @@ -1149,7 +1131,7 @@ class PutVisualTextActionTest : VimTestCase() { The features it combines mark it as new to science: shape and shade -- the special tinge, akin to moonlight, tempering its blue, - $c|found| + |found| |l roc| |ere i| """, @@ -1171,8 +1153,7 @@ class PutVisualTextActionTest : VimTestCase() { the dingy ${c}underside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("V" + "p")) val after = """ A Discovery @@ -1207,7 +1188,7 @@ class PutVisualTextActionTest : VimTestCase() { The features it combines mark it as new to science: shape and shade -- the special tinge, akin to moonlight, tempering its blue, - $c|found| + |found| |l roc| |ere i| |found| @@ -1232,8 +1213,7 @@ class PutVisualTextActionTest : VimTestCase() { the dingy ${c}underside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("V" + "2p")) val after = """ A Discovery @@ -1260,7 +1240,7 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - $c|found| + |found| |l roc| |ere i| al|l roc|ks and lavender and tufted grass, @@ -1270,7 +1250,7 @@ class PutVisualTextActionTest : VimTestCase() { The features it combines mark it as new to science: shape and shade -- the special tinge, akin to moonlight, tempering its blue, - $c|found| + |found| |l roc| |ere i| """, @@ -1321,7 +1301,7 @@ class PutVisualTextActionTest : VimTestCase() { originalVimAfter = """ A Discovery - $c|found| + |found| |l roc| |ere i| al|l roc|ks and lavender and tufted grass, @@ -1331,7 +1311,7 @@ class PutVisualTextActionTest : VimTestCase() { The features it combines mark it as new to science: shape and shade -- the special tinge, akin to moonlight, tempering its blue, - $c|found| + |found| |l roc| |ere i| """, @@ -1408,8 +1388,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("2e2j" + "p")) val after = """ A Discovery @@ -1434,8 +1413,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("3e2k" + "p")) val after = """ A Discovery @@ -1460,8 +1438,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("2e2j" + "2p")) val after = """ A Discovery @@ -1486,8 +1463,7 @@ class PutVisualTextActionTest : VimTestCase() { ha|rd by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "Discovery", SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("3j$" + "p")) val after = """ A Discovery @@ -1509,7 +1485,7 @@ class PutVisualTextActionTest : VimTestCase() { I it in a legendary land alks and lavender and tufted grass, wht was settled on some sodden sand - ${c}A Discovery + A Discovery hard by the torrent of a mountain pass. """, ) @@ -1519,14 +1495,13 @@ class PutVisualTextActionTest : VimTestCase() { val before = """ A Discovery - I $c|found| it in a legendary land + I |found| it in a legendary land al|l roc|ks and lavender and tufted grass, wh|ere i|t was settled on some sodden sand hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("2e2j" + "p")) val after = """ A Discovery @@ -1534,7 +1509,7 @@ class PutVisualTextActionTest : VimTestCase() { I it in a legendary land alks and lavender and tufted grass, wht was settled on some sodden sand - ${c}A Discovery + A Discovery hard by the torrent of a mountain pass. """.trimIndent() @@ -1553,8 +1528,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("2e2j" + "P")) val after = """ A Discovery @@ -1575,7 +1549,7 @@ class PutVisualTextActionTest : VimTestCase() { I it in a legendary land alks and lavender and tufted grass, wht was settled on some sodden sand - ${c}A Discovery + A Discovery A Discovery hard by the torrent of a mountain pass. """, @@ -1592,8 +1566,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("2e2j" + "2p")) val after = """ A Discovery @@ -1617,7 +1590,7 @@ class PutVisualTextActionTest : VimTestCase() { alks and lavender and tufted grass, wht was settled on some sodden sand ha the torrent of a mountain pass. - ${c}A Discovery + A Discovery """, ) @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @@ -1632,8 +1605,7 @@ class PutVisualTextActionTest : VimTestCase() { ha|rd by| the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("2e3j" + "p")) val after = """ A Discovery @@ -1655,7 +1627,7 @@ class PutVisualTextActionTest : VimTestCase() { I a w - ${c}A Discovery + A Discovery hard by the torrent of a mountain pass. """, ) @@ -1671,8 +1643,7 @@ class PutVisualTextActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), before rangeOf "A Discovery\n", SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("2j$" + "p")) val after = """ A Discovery @@ -1706,8 +1677,7 @@ class PutVisualTextActionTest : VimTestCase() { the dingy underside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("2e2j" + "p")) val after = """ A Discovery @@ -1742,8 +1712,7 @@ class PutVisualTextActionTest : VimTestCase() { the |dingy un|derside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("2e3j" + "p")) val after = """ A Discovery @@ -1778,8 +1747,7 @@ class PutVisualTextActionTest : VimTestCase() { the dingy underside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("2ej" + "p")) val after = """ A Discovery @@ -1814,8 +1782,7 @@ class PutVisualTextActionTest : VimTestCase() { the ding|y undersi|de, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("elj" + "p")) val after = """ A Discovery @@ -1851,8 +1818,7 @@ class PutVisualTextActionTest : VimTestCase() { the dingy underside, the checquered fringe. """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), editor.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), editor.ij.rangeOf("|found|", 2), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("2j$" + "p")) val after = """ A Discovery diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutVisualTextMoveCursorActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutVisualTextMoveCursorActionTest.kt index 973b896880..492481519b 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutVisualTextMoveCursorActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/PutVisualTextMoveCursorActionTest.kt @@ -11,12 +11,11 @@ package org.jetbrains.plugins.ideavim.action.copy import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.common.TextRange -import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.annotations.TestWithoutPrimaryClipboard import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -25,15 +24,14 @@ import org.junit.jupiter.api.Test * @author Alex Plate */ -class PutVisualTextMoveCursorActionTest : VimTestCase() { +class PutVisualTextMoveCursorActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test fun `test put visual text`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("v2e" + "2gp")) val after = "legendarylegendary$c in a legendary land" assertState(after) @@ -44,8 +42,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { fun `test put visual text linewise`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 25), SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 25), SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("v2e" + "gp")) val after = """ @@ -60,8 +57,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { fun `test put visual text line linewise`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("V" + "gp")) val after = "legendary\n$c" assertState(after) @@ -87,8 +83,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { hard by the torrent of a mountain pass. """.trimIndent() val editor = configureByText(file) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(2, 11), SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(2, 11), SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("V" + "gp")) assertState(newFile) } @@ -101,7 +96,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { rocks and lavender and tufted grass, re it was settled on some sodden sand d by the torrent of a mountain pass. - ${c}A Discovery + A Discovery """, ) @Test @@ -133,8 +128,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { fun `test Put visual text linewise`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 25), SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 25), SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("v2e" + "gP")) val after = """ @@ -149,8 +143,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { fun `test Put visual text`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("v2e" + "2gP")) val after = "legendarylegendary$c in a legendary land" assertState(after) @@ -161,8 +154,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { fun `test Put visual text full line`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("v$" + "2gP")) val after = "legendarylegendar${c}y" assertState(after) @@ -173,8 +165,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { fun `test Put visual text line linewise`() { val before = "${c}I found it in a legendary land" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 25), SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("V" + "gP")) val after = "legendary\n$c" assertState(after) @@ -272,8 +263,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { vbn """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 19), SelectionType.BLOCK_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 19), SelectionType.BLOCK_WISE, false) typeText(injector.parser.parseKeys("" + "gp")) val after = """ ${c}fgh @@ -298,8 +288,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { vbn """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 19), SelectionType.LINE_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 19), SelectionType.LINE_WISE, false) typeText(injector.parser.parseKeys("" + "h" + "gp")) val after = """ q @@ -319,8 +308,7 @@ class PutVisualTextMoveCursorActionTest : VimTestCase() { fun `test put visual text multicaret`() { val before = "${c}qwe asd ${c}zxc rty ${c}fgh vbn" val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister().storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) typeText(injector.parser.parseKeys("v2e" + "2gp")) val after = "fghfgh$c fghfgh$c fghfgh$c" assertState(after) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankAndPutTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankAndPutTest.kt index 5a6aadcd9c..779b7869da 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankAndPutTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankAndPutTest.kt @@ -11,14 +11,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.TestOptionConstants -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.annotations.TestWithoutPrimaryClipboard import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.clipboard) -class YankAndPutTest : VimTestCase() { +class YankAndPutTest : VimTestCaseBase() { @OptionTest(VimOption(TestOptionConstants.clipboard, limitedValues = [OptionConstants.clipboard_unnamedplus])) fun `test yank to number register with unnamedplus`() { val before = """ diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankLineActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankLineActionTest.kt index 4445aeb245..9f0d9e7fd0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankLineActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankLineActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.copy import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class YankLineActionTest : VimTestCase() { +class YankLineActionTest : VimTestCaseBase() { @Test fun `test yank to number register`() { val before = """ diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankMotionActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankMotionActionTest.kt index fa196572ca..a226ece27a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankMotionActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankMotionActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.copy import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class YankMotionActionTest : VimTestCase() { +class YankMotionActionTest : VimTestCaseBase() { @Test fun `test yank till new line`() { val file = """ diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankVisualActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankVisualActionTest.kt index ba23439023..74800e7e1f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankVisualActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankVisualActionTest.kt @@ -17,13 +17,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import javax.swing.KeyStroke import kotlin.test.assertNotNull -class YankVisualActionTest : VimTestCase() { +class YankVisualActionTest : VimTestCaseBase() { @Test fun `test simple yank`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankVisualLinesActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankVisualLinesActionTest.kt index 1b9606fc0b..090bce0593 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankVisualLinesActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/copy/YankVisualLinesActionTest.kt @@ -11,13 +11,13 @@ package org.jetbrains.plugins.ideavim.action.copy import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class YankVisualLinesActionTest : VimTestCase() { +class YankVisualLinesActionTest : VimTestCaseBase() { @Test fun `test from visual mode`() { val text = """ diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/GnNextTextObjectTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/GnNextTextObjectTest.kt index 7e3d9465bb..2b8aafef40 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/GnNextTextObjectTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/GnNextTextObjectTest.kt @@ -16,11 +16,11 @@ import com.maddyhome.idea.vim.common.Direction import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import javax.swing.KeyStroke -class GnNextTextObjectTest : VimTestCase() { +class GnNextTextObjectTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test fun `test delete word`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/GnPreviousTextObjectTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/GnPreviousTextObjectTest.kt index c2e15a1acd..68e1670dde 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/GnPreviousTextObjectTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/GnPreviousTextObjectTest.kt @@ -16,11 +16,11 @@ import com.maddyhome.idea.vim.common.Direction import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import javax.swing.KeyStroke -class GnPreviousTextObjectTest : VimTestCase() { +class GnPreviousTextObjectTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test fun `test delete word`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/VisualSelectNextSearchTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/VisualSelectNextSearchTest.kt index d3219a2405..7492cfd0a7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/VisualSelectNextSearchTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/VisualSelectNextSearchTest.kt @@ -16,11 +16,11 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") -class VisualSelectNextSearchTest : VimTestCase() { +class VisualSelectNextSearchTest : VimTestCaseBase() { @TestFor(classes = [SearchWholeWordForwardAction::class]) @Test fun testSearch() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/VisualSelectPreviousSearchTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/VisualSelectPreviousSearchTest.kt index c14c7d97e3..8aa7678b41 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/VisualSelectPreviousSearchTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/gn/VisualSelectPreviousSearchTest.kt @@ -16,11 +16,11 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") -class VisualSelectPreviousSearchTest : VimTestCase() { +class VisualSelectPreviousSearchTest : VimTestCaseBase() { @TestFor(classes = [SearchWholeWordForwardAction::class]) @Test fun testSearch() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionArrowLeftActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionArrowLeftActionTest.kt index 67af7f14ec..255484c2ee 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionArrowLeftActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionArrowLeftActionTest.kt @@ -17,13 +17,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel) -class MotionArrowLeftActionTest : VimTestCase() { +class MotionArrowLeftActionTest : VimTestCaseBase() { // 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 diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionArrowRightActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionArrowRightActionTest.kt index 96e643d31d..e78074b3c9 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionArrowRightActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionArrowRightActionTest.kt @@ -17,13 +17,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel) -class MotionArrowRightActionTest : VimTestCase() { +class MotionArrowRightActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.INLAYS) @OptionTest(VimOption(TestOptionConstants.keymodel, doesntAffectTest = true)) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionBackspaceActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionBackspaceActionTest.kt index 9dbacdb913..84ddde6604 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionBackspaceActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionBackspaceActionTest.kt @@ -10,10 +10,10 @@ 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.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionBackspaceActionTest : VimTestCase() { +class MotionBackspaceActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @Test fun `test whichwrap in the same line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionEndActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionEndActionTest.kt index 5e7b23174d..d3a41859bb 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionEndActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionEndActionTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel) -class MotionEndActionTest : VimTestCase() { +class MotionEndActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest(VimOption(TestOptionConstants.keymodel, doesntAffectTest = true)) fun `test motion end`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionHomeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionHomeActionTest.kt index 7fc971a606..e7212fd234 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionHomeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionHomeActionTest.kt @@ -16,14 +16,14 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption import kotlin.test.assertTrue @TraceOptions(TestOptionConstants.keymodel) -class MotionHomeActionTest : VimTestCase() { +class MotionHomeActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest(VimOption(TestOptionConstants.keymodel, doesntAffectTest = true)) fun `test motion home`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLastColumnActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLastColumnActionTest.kt index 37df9889ef..7f58b81597 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLastColumnActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLastColumnActionTest.kt @@ -15,10 +15,10 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionLastColumnActionTest : VimTestCase() { +class MotionLastColumnActionTest : VimTestCaseBase() { @Test fun `test dollar motion`() { val keys = "$" @@ -112,9 +112,9 @@ class MotionLastColumnActionTest : VimTestCase() { originalVimAfter = """ A Discovery - I ${s}found it in a legendary lan${c}d${se} - al${s}l rocks and lavender and tufted grass${c},${se}[ additional symbols] - wh${s}ere it was settled on some sodden san${c}d${se} + I ${s}found it in a legendary land${se} + al${s}l rocks and lavender and tufted grass,${se}[ additional symbols] + wh${s}ere it was settled on some sodden sand${se} hard by the torrent of a mountain pass. """, ) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftActionTest.kt index ef48c1fffa..36cec50f17 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftActionTest.kt @@ -10,10 +10,10 @@ 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.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionLeftActionTest : VimTestCase() { +class MotionLeftActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @Test fun `test whichwrap in the same line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftInsertTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftInsertTest.kt index 643a67102e..07eeff448d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftInsertTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftInsertTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionLeftInsertTest : VimTestCase() { +class MotionLeftInsertTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @Test fun `test whichwrap in the same line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftMatchCharActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftMatchCharActionTest.kt index bcf0fb6a53..1575e7caf9 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftMatchCharActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftMatchCharActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionLeftMatchCharActionTest : VimTestCase() { +class MotionLeftMatchCharActionTest : VimTestCaseBase() { @Test fun `test move and repeat`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftTillMatchCharActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftTillMatchCharActionTest.kt index 4e6e2e48bc..23b31f270a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftTillMatchCharActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionLeftTillMatchCharActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionLeftTillMatchCharActionTest : VimTestCase() { +class MotionLeftTillMatchCharActionTest : VimTestCaseBase() { @Test fun `test move and repeat`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightActionTest.kt index c5857c7970..cb35888e46 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightActionTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.virtualedit) -class MotionRightActionTest : VimTestCase() { +class MotionRightActionTest : VimTestCaseBase() { @OptionTest(VimOption(TestOptionConstants.virtualedit, doesntAffectTest = true)) fun `test simple motion`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightInsertTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightInsertTest.kt index d791ad39ab..576af89dce 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightInsertTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightInsertTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionRightInsertTest : VimTestCase() { +class MotionRightInsertTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @Test fun `test whichwrap in the same line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightMatchCharActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightMatchCharActionTest.kt index 84884c0bd6..21965d437b 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightMatchCharActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightMatchCharActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionRightMatchCharActionTest : VimTestCase() { +class MotionRightMatchCharActionTest : VimTestCaseBase() { @Test fun `test move and repeat`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightTillMatchCharActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightTillMatchCharActionTest.kt index 5cf1def171..d5ff46a403 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightTillMatchCharActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionRightTillMatchCharActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.leftright import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionRightTillMatchCharActionTest : VimTestCase() { +class MotionRightTillMatchCharActionTest : VimTestCaseBase() { @Test fun `test move and repeat`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftEndActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftEndActionTest.kt index 2397b3c782..faefef2918 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftEndActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftEndActionTest.kt @@ -17,13 +17,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel, TestOptionConstants.selectmode) -class MotionShiftEndActionTest : VimTestCase() { +class MotionShiftEndActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest( VimOption(TestOptionConstants.keymodel, doesntAffectTest = true), diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftHomeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftHomeActionTest.kt index 9bbfde1e13..4ebefababd 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftHomeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftHomeActionTest.kt @@ -17,14 +17,14 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption import kotlin.test.assertTrue @TraceOptions(TestOptionConstants.keymodel, TestOptionConstants.selectmode) -class MotionShiftHomeActionTest : VimTestCase() { +class MotionShiftHomeActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest( VimOption(TestOptionConstants.keymodel, doesntAffectTest = true), diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftLeftActionHandlerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftLeftActionHandlerTest.kt index 53090b45c3..90631f82df 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftLeftActionHandlerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftLeftActionHandlerTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel, TestOptionConstants.selectmode) -class MotionShiftLeftActionHandlerTest : VimTestCase() { +class MotionShiftLeftActionHandlerTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest( VimOption(TestOptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]), diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftRightActionHandlerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftRightActionHandlerTest.kt index 0c0c13ba57..2d05a1e055 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftRightActionHandlerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionShiftRightActionHandlerTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel, TestOptionConstants.selectmode) -class MotionShiftRightActionHandlerTest : VimTestCase() { +class MotionShiftRightActionHandlerTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest( VimOption(TestOptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]), diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionSpaceActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionSpaceActionTest.kt index b6b9f0860b..5ee2922fe0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionSpaceActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/leftright/MotionSpaceActionTest.kt @@ -10,10 +10,10 @@ 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.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionSpaceActionTest : VimTestCase() { +class MotionSpaceActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @Test fun `test whichwrap in the same line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/mark/MotionMarkActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/mark/MotionMarkActionTest.kt index 39a6b844dc..83f64853e4 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/mark/MotionMarkActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/mark/MotionMarkActionTest.kt @@ -15,13 +15,13 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.group.createLineBookmark import com.maddyhome.idea.vim.group.mnemonic import org.jetbrains.plugins.ideavim.TestIjOptionConstants -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestIjOptionConstants.ideamarks) -class MotionMarkActionTest : VimTestCase() { +class MotionMarkActionTest : VimTestCaseBase() { @OptionTest(VimOption(TestIjOptionConstants.ideamarks, limitedValues = ["true"])) fun `test simple add mark`() { val keys = injector.parser.parseKeys("mA") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBigWordActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBigWordActionTest.kt index a3a0b5c8ee..3bfa4e2f89 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBigWordActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBigWordActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.`object` import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionInnerBigWordActionTest : VimTestCase() { +class MotionInnerBigWordActionTest : VimTestCaseBase() { @Test fun `test at last dot`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockDoubleQuoteActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockDoubleQuoteActionTest.kt index 54053150b9..ac1f47b96f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockDoubleQuoteActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockDoubleQuoteActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.`object` import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionInnerBlockDoubleQuoteActionTest : VimTestCase() { +class MotionInnerBlockDoubleQuoteActionTest : VimTestCaseBase() { @Test fun `test change outside quotes`() { doTest("di\"", "${c}print(\"hello\")", "print(\"$c\")", Mode.NORMAL()) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockParenActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockParenActionTest.kt index 1cd3745500..cac2f428d9 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockParenActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockParenActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.`object` import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionInnerBlockParenActionTest : VimTestCase() { +class MotionInnerBlockParenActionTest : VimTestCaseBase() { // VIM-1633 |v_i)| @Test fun `test single letter with single parentheses`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockTagActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockTagActionTest.kt index 52e4c1430c..a6c9c71ebd 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockTagActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerBlockTagActionTest.kt @@ -13,10 +13,10 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionInnerBlockTagActionTest : VimTestCase() { +class MotionInnerBlockTagActionTest : VimTestCaseBase() { // |d| |v_it| @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerWordActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerWordActionTest.kt index e4f4ad3c2b..d04c4f2cc1 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerWordActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionInnerWordActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.motion.`object` import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionInnerWordActionTest : VimTestCase() { +class MotionInnerWordActionTest : VimTestCaseBase() { @Test fun `test empty text`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBigWordActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBigWordActionTest.kt index 03efd8ba19..49e147b5a9 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBigWordActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBigWordActionTest.kt @@ -12,10 +12,10 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionOuterBigWordActionTest : VimTestCase() { +class MotionOuterBigWordActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.UNCLEAR, description = "Wrong caret position, but in real neovim works fine") @Test fun `test on last dot`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockBraceActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockBraceActionTest.kt index 354f5f2b2a..40ae4b7ad4 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockBraceActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockBraceActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.`object` import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionOuterBlockBraceActionTest : VimTestCase() { +class MotionOuterBlockBraceActionTest : VimTestCaseBase() { @Test fun testOutside() { typeTextInFile( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockParenActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockParenActionTest.kt index 9f75e0c082..91f5473c51 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockParenActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockParenActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.`object` import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionOuterBlockParenActionTest : VimTestCase() { +class MotionOuterBlockParenActionTest : VimTestCaseBase() { // VIM-1633 |v_a)| @Test fun `test single letter with single parentheses`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockTagActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockTagActionTest.kt index 4696b65e88..3e5d86bdf1 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockTagActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterBlockTagActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.`object` import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionOuterBlockTagActionTest : VimTestCase() { +class MotionOuterBlockTagActionTest : VimTestCaseBase() { // |d| |v_at| @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterSentenceActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterSentenceActionTest.kt index 0807496890..56cc56922d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterSentenceActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/object/MotionOuterSentenceActionTest.kt @@ -10,16 +10,16 @@ package org.jetbrains.plugins.ideavim.action.motion.`object` import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionOuterSentenceActionTest : VimTestCase() { +class MotionOuterSentenceActionTest : VimTestCaseBase() { @VimBehaviorDiffers( originalVimAfter = """ Lorem ipsum dolor sit amet, consectetur adipiscing elit Sed in orci mauris. - $c + """, ) @Test @@ -47,7 +47,7 @@ class MotionOuterSentenceActionTest : VimTestCase() { Lorem ipsum dolor sit amet, consectetur adipiscing elit Sed in orci mauris. - $c + """, ) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionFirstScreenLineActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionFirstScreenLineActionTest.kt index 25eff84454..6fa8a503cd 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionFirstScreenLineActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionFirstScreenLineActionTest.kt @@ -12,10 +12,10 @@ import com.maddyhome.idea.vim.api.getOffset import com.maddyhome.idea.vim.newapi.vim import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionFirstScreenLineActionTest : VimTestCase() { +class MotionFirstScreenLineActionTest : VimTestCaseBase() { @Test fun `test move caret to first line of screen`() { configureByLines(50, " I found it in a legendary land") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionLastScreenLineActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionLastScreenLineActionTest.kt index 397e45d40d..d38db14265 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionLastScreenLineActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionLastScreenLineActionTest.kt @@ -12,10 +12,10 @@ import com.maddyhome.idea.vim.api.getOffset import com.maddyhome.idea.vim.newapi.IjVimEditor import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionLastScreenLineActionTest : VimTestCase() { +class MotionLastScreenLineActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun `test move caret to last line of screen`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionMiddleScreenLineActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionMiddleScreenLineActionTest.kt index 6fd3d48b22..7b4814a342 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionMiddleScreenLineActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/screen/MotionMiddleScreenLineActionTest.kt @@ -12,10 +12,10 @@ import com.maddyhome.idea.vim.api.getOffset import com.maddyhome.idea.vim.newapi.vim import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionMiddleScreenLineActionTest : VimTestCase() { +class MotionMiddleScreenLineActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test fun `test move caret to middle line of full screen with odd number of lines`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchAgainNextActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchAgainNextActionTest.kt index 4d4501ccaf..b2548e5139 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchAgainNextActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchAgainNextActionTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.action.motion.search -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SearchAgainNextActionTest : VimTestCase() { +class SearchAgainNextActionTest : VimTestCaseBase() { @Test fun `test search next updates status line`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchAgainPreviousActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchAgainPreviousActionTest.kt index 414f6682cd..4d913c35d1 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchAgainPreviousActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchAgainPreviousActionTest.kt @@ -12,10 +12,10 @@ import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.common.Direction import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SearchAgainPreviousActionTest : VimTestCase() { +class SearchAgainPreviousActionTest : VimTestCaseBase() { @Test fun `test search previous updates status line`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchEntryFwdActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchEntryFwdActionTest.kt index 031d2319a4..e94bcf7101 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchEntryFwdActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchEntryFwdActionTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.action.motion.search import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class SearchEntryFwdActionTest : VimTestCase() { +class SearchEntryFwdActionTest : VimTestCaseBase() { @Test fun `test search clears status line`() { configureByText("lorem ipsum") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchWholeWordBackwardActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchWholeWordBackwardActionTest.kt index 1fa8712773..51999c0d69 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchWholeWordBackwardActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchWholeWordBackwardActionTest.kt @@ -9,13 +9,13 @@ package org.jetbrains.plugins.ideavim.action.motion.search import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class SearchWholeWordBackwardActionTest : VimTestCase() { +class SearchWholeWordBackwardActionTest : VimTestCaseBase() { @Test fun `test backward search on empty string`() { doTest("#", "", "", Mode.NORMAL()) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchWholeWordForwardActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchWholeWordForwardActionTest.kt index b8c8866be4..64acd70284 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchWholeWordForwardActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/search/SearchWholeWordForwardActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.motion.search import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SearchWholeWordForwardActionTest : VimTestCase() { +class SearchWholeWordForwardActionTest : VimTestCaseBase() { @Test fun `test with tabs`() { val before = """ @@ -42,7 +42,7 @@ class SearchWholeWordForwardActionTest : VimTestCase() { I found it in a legendary land all rocks and lavender and tufted grass, where it was settled on some sodden sand - hard by the torrent of a mountain pass$c. + hard by the torrent of a mountain pass. """, ) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableBlockModeActionHandlerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableBlockModeActionHandlerTest.kt index e99b8ea64c..62ecea9f2d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableBlockModeActionHandlerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableBlockModeActionHandlerTest.kt @@ -12,10 +12,10 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SelectEnableBlockModeActionHandlerTest : VimTestCase() { +class SelectEnableBlockModeActionHandlerTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SELECT_MODE) @Test fun `test entering select mode`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableCharacterModeActionHandlerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableCharacterModeActionHandlerTest.kt index 1eeeaa2ee5..1e8711a20d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableCharacterModeActionHandlerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableCharacterModeActionHandlerTest.kt @@ -12,10 +12,10 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SelectEnableCharacterModeActionHandlerTest : VimTestCase() { +class SelectEnableCharacterModeActionHandlerTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SELECT_MODE) @Test fun `test entering select mode`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableLineModeActionHandlerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableLineModeActionHandlerTest.kt index 317613bfd2..99cc2e318e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableLineModeActionHandlerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEnableLineModeActionHandlerTest.kt @@ -12,10 +12,10 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SelectEnableLineModeActionHandlerTest : VimTestCase() { +class SelectEnableLineModeActionHandlerTest : VimTestCaseBase() { @Test fun `test entering select mode`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEscapeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEscapeActionTest.kt index 8e34dfdb07..3c11add6f0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEscapeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectEscapeActionTest.kt @@ -12,10 +12,10 @@ import com.intellij.openapi.editor.Caret import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SelectEscapeActionTest : VimTestCase() { +class SelectEscapeActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SELECT_MODE) @Test fun `test exit char mode`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectKeyHandlerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectKeyHandlerTest.kt index 60ad033deb..d5800a5562 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectKeyHandlerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectKeyHandlerTest.kt @@ -12,14 +12,14 @@ import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class SelectKeyHandlerTest : VimTestCase() { +class SelectKeyHandlerTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SELECT_MODE) @Test fun `test type in select mode`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectToggleVisualModeHandlerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectToggleVisualModeHandlerTest.kt index 0caac4b3c5..559a9868a1 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectToggleVisualModeHandlerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/SelectToggleVisualModeHandlerTest.kt @@ -15,10 +15,10 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SelectToggleVisualModeHandlerTest : VimTestCase() { +class SelectToggleVisualModeHandlerTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SELECT_MODE) @Test fun `test switch to select mode characterwise`() { @@ -298,7 +298,7 @@ class SelectToggleVisualModeHandlerTest : VimTestCase() { originalVimAfter = """ A Discovery - ${s}${c}I${se} found it in a legendary land + ${s}I${se} found it in a legendary land all rocks and lavender and tufted grass, where it was settled on some sodden sand hard by the torrent of a mountain pass. @@ -334,7 +334,7 @@ class SelectToggleVisualModeHandlerTest : VimTestCase() { A Discovery ${s}I found it in a legendary land - ${c}a${se}ll rocks and lavender and tufted grass, + a${se}ll rocks and lavender and tufted grass, where it was settled on some sodden sand hard by the torrent of a mountain pass. """, diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectExtendVariousMotionsTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectExtendVariousMotionsTest.kt index 8ab3dd80ff..032d192bb3 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectExtendVariousMotionsTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectExtendVariousMotionsTest.kt @@ -13,7 +13,7 @@ package org.jetbrains.plugins.ideavim.action.motion.select.motion import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test * * All dots in these tests are replaced with tabs */ -class SelectExtendVariousMotionsTest : VimTestCase() { +class SelectExtendVariousMotionsTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.TABS) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectMotionLeftActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectMotionLeftActionTest.kt index ecd051c41c..b9b19a6975 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectMotionLeftActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectMotionLeftActionTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel) -class SelectMotionLeftActionTest : VimTestCase() { +class SelectMotionLeftActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest( VimOption( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectMotionRightActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectMotionRightActionTest.kt index 83e3d265d6..9ca4b5663a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectMotionRightActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/select/motion/SelectMotionRightActionTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel) -class SelectMotionRightActionTest : VimTestCase() { +class SelectMotionRightActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest(VimOption(TestOptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_stopselect])) fun `test char select simple move`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionCamelEndLeftActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionCamelEndLeftActionTest.kt index 6165833a22..5f400794d8 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionCamelEndLeftActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionCamelEndLeftActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionCamelEndLeftActionTest : VimTestCase() { +class MotionCamelEndLeftActionTest : VimTestCaseBase() { @Test fun `test go with a single uppercase word`() { doTest("]b", "TES${c}T", "TES${c}T", Mode.NORMAL()) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionNthCharacterActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionNthCharacterActionTest.kt index 6c0085211e..a7f6fbc0b3 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionNthCharacterActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionNthCharacterActionTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionNthCharacterActionTest : VimTestCase() { +class MotionNthCharacterActionTest : VimTestCaseBase() { @Test fun `test goto without count`() { doTest( @@ -166,7 +166,7 @@ class MotionNthCharacterActionTest : VimTestCase() { I found it in a legendary land all rocks and lavender and tufted grass, where it was settled on some sodden sand - hard by the torrent of a mountain pass.$c + hard by the torrent of a mountain pass. """, ) @Test @@ -201,7 +201,7 @@ class MotionNthCharacterActionTest : VimTestCase() { all rocks and lavender and tufted grass, where it was settled on some sodden sand hard by the torrent of a mountain pass. - $c + """, ) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionParagraphNextActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionParagraphNextActionTest.kt index de598df385..b4938a0f66 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionParagraphNextActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionParagraphNextActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionParagraphNextActionTest : VimTestCase() { +class MotionParagraphNextActionTest : VimTestCaseBase() { @Test fun `test delete paragraph`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionParagraphPreviousActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionParagraphPreviousActionTest.kt index aef9eeccf0..48e6267a01 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionParagraphPreviousActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionParagraphPreviousActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionParagraphPreviousActionTest : VimTestCase() { +class MotionParagraphPreviousActionTest : VimTestCaseBase() { @VimBehaviorDiffers("") @Test fun `test delete till start with empty line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSectionForwardEndActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSectionForwardEndActionTest.kt index 2a269f8a53..eecbbfc211 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSectionForwardEndActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSectionForwardEndActionTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionSectionForwardEndActionTest : VimTestCase() { - @VimBehaviorDiffers(originalVimAfter = c, description = "Full text is deleted") +class MotionSectionForwardEndActionTest : VimTestCaseBase() { + @VimBehaviorDiffers(originalVimAfter = "", description = "Full text is deleted") @Test fun `test remove full text`() { doTest( @@ -30,7 +30,7 @@ class MotionSectionForwardEndActionTest : VimTestCase() { ) } - @VimBehaviorDiffers(originalVimAfter = c, description = "Full text is deleted") + @VimBehaviorDiffers(originalVimAfter = "", description = "Full text is deleted") @Test fun `test remove full text with new line at the end`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSectionForwardStartActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSectionForwardStartActionTest.kt index 69596399e7..5dedd0ace6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSectionForwardStartActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSectionForwardStartActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionSectionForwardStartActionTest : VimTestCase() { +class MotionSectionForwardStartActionTest : VimTestCaseBase() { @Test fun `test move forward`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSentenceNextStartActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSentenceNextStartActionTest.kt index bea0517476..06a61b53ee 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSentenceNextStartActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSentenceNextStartActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionSentenceNextStartActionTest : VimTestCase() { +class MotionSentenceNextStartActionTest : VimTestCaseBase() { @Test fun `test with two empty lines`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSentencePreviousStartActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSentencePreviousStartActionTest.kt index 40adcf550f..952bc58b95 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSentencePreviousStartActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionSentencePreviousStartActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionSentencePreviousStartActionTest : VimTestCase() { +class MotionSentencePreviousStartActionTest : VimTestCaseBase() { @Test fun `test with two empty lines`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionUnmatchedBraceCloseActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionUnmatchedBraceCloseActionTest.kt index 16950f93a5..03b88951b0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionUnmatchedBraceCloseActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionUnmatchedBraceCloseActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionUnmatchedBraceCloseActionTest : VimTestCase() { +class MotionUnmatchedBraceCloseActionTest : VimTestCaseBase() { @Test fun `test go to bracket`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionUnmatchedBraceOpenActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionUnmatchedBraceOpenActionTest.kt index c1154ca593..11c98ea66e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionUnmatchedBraceOpenActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/text/MotionUnmatchedBraceOpenActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.text import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionUnmatchedBraceOpenActionTest : VimTestCase() { +class MotionUnmatchedBraceOpenActionTest : VimTestCaseBase() { @Test fun `test go to bracket`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/EnterNormalActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/EnterNormalActionTest.kt index 6557cdde43..7ba767ad0b 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/EnterNormalActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/EnterNormalActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.updown import com.intellij.idea.TestFor -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class EnterNormalActionTest : VimTestCase() { +class EnterNormalActionTest : VimTestCaseBase() { @Test @TestFor(issues = ["VIM-3190"]) fun `mapping to control enter`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionArrowDownActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionArrowDownActionTest.kt index 52603e6781..b0d0a21a07 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionArrowDownActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionArrowDownActionTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel, TestOptionConstants.virtualedit) -class MotionArrowDownActionTest : VimTestCase() { +class MotionArrowDownActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest( VimOption(TestOptionConstants.keymodel, doesntAffectTest = true), diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionArrowUpActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionArrowUpActionTest.kt index be0c0cc113..0dc350ede3 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionArrowUpActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionArrowUpActionTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel) -class MotionArrowUpActionTest : VimTestCase() { +class MotionArrowUpActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest(VimOption(TestOptionConstants.keymodel, doesntAffectTest = true)) fun `test visual default options`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionDownActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionDownActionTest.kt index c6aa9c91c6..f9ba90a7de 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionDownActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionDownActionTest.kt @@ -14,14 +14,14 @@ import com.intellij.codeInsight.daemon.impl.HintRenderer import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class MotionDownActionTest : VimTestCase() { +class MotionDownActionTest : VimTestCaseBase() { @Test fun `test motion down in visual block mode`() { val keys = "2kjjj" diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineFirstActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineFirstActionTest.kt index 31e452b03a..f9c3ebe23d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineFirstActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineFirstActionTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.action.motion.updown import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionGotoLineFirstActionTest : VimTestCase() { +class MotionGotoLineFirstActionTest : VimTestCaseBase() { @Test fun `test simple motion`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineFirstInsertActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineFirstInsertActionTest.kt index 51df9de6aa..c2cdd5e7c7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineFirstInsertActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineFirstInsertActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.motion.updown import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionGotoLineFirstInsertActionTest : VimTestCase() { +class MotionGotoLineFirstInsertActionTest : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.OPTION) @Test fun `test simple motion`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineLastActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineLastActionTest.kt index 040c2064e8..d2bfb3475b 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineLastActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionGotoLineLastActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.motion.updown import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionGotoLineLastActionTest : VimTestCase() { +class MotionGotoLineLastActionTest : VimTestCaseBase() { @Test fun `test simple motion`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionPercentOrMatchActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionPercentOrMatchActionTest.kt index 8ce4a5f44a..6bdbafa383 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionPercentOrMatchActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionPercentOrMatchActionTest.kt @@ -12,14 +12,14 @@ import com.intellij.idea.TestFor import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class MotionPercentOrMatchActionTest : VimTestCase() { +class MotionPercentOrMatchActionTest : VimTestCaseBase() { @Test fun `test percent match simple`() { typeTextInFile( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionShiftDownActionHandlerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionShiftDownActionHandlerTest.kt index 8b043b634f..785bd9db50 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionShiftDownActionHandlerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionShiftDownActionHandlerTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.keymodel, TestOptionConstants.selectmode) -class MotionShiftDownActionHandlerTest : VimTestCase() { +class MotionShiftDownActionHandlerTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest( VimOption(TestOptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]), diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionShiftUpActionHandlerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionShiftUpActionHandlerTest.kt index 91e08f3fe4..b91cce1bcc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionShiftUpActionHandlerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionShiftUpActionHandlerTest.kt @@ -16,13 +16,13 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @TraceOptions(TestOptionConstants.selectmode, TestOptionConstants.keymodel) -class MotionShiftUpActionHandlerTest : VimTestCase() { +class MotionShiftUpActionHandlerTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest( VimOption(TestOptionConstants.keymodel, limitedValues = [OptionConstants.keymodel_startsel]), diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionUpActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionUpActionTest.kt index 8d41c341e7..25ee914487 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionUpActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionUpActionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.action.motion.updown import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MotionUpActionTest : VimTestCase() { +class MotionUpActionTest : VimTestCaseBase() { @Test fun `test last column empty`() { val keys = "k" diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionUpCtrlPAction.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionUpCtrlPAction.kt index 72d45fd362..40ec52b4f6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionUpCtrlPAction.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/MotionUpCtrlPAction.kt @@ -8,11 +8,11 @@ package org.jetbrains.plugins.ideavim.action.motion.updown -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class MotionUpCtrlPAction : VimTestCase() { +class MotionUpCtrlPAction : VimTestCaseBase() { @Test @Disabled("This one should be fixed") fun `test last column empty`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/VisualVariousMotionsTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/VisualVariousMotionsTest.kt index 96ce40a947..b1a48af857 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/VisualVariousMotionsTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/VisualVariousMotionsTest.kt @@ -11,13 +11,13 @@ package org.jetbrains.plugins.ideavim.action.motion.updown import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class VisualVariousMotionsTest : VimTestCase() { +class VisualVariousMotionsTest : VimTestCaseBase() { @Test fun `test with tabs`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualExitModeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualExitModeActionTest.kt index 7ea8b55ae8..4566fae132 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualExitModeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualExitModeActionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action.motion.visual import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class VisualExitModeActionTest : VimTestCase() { +class VisualExitModeActionTest : VimTestCaseBase() { @Test fun `test exit visual mode after line end`() { doTest("vl", "12${c}3", "12${c}3", Mode.NORMAL()) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualSwapEndsBlockActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualSwapEndsBlockActionTest.kt index 873e162994..4e25c25d40 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualSwapEndsBlockActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualSwapEndsBlockActionTest.kt @@ -16,10 +16,10 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class VisualSwapEndsBlockActionTest : VimTestCase() { +class VisualSwapEndsBlockActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.VISUAL_BLOCK_MODE) @Test fun `test simple block selection SE`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleBlockModeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleBlockModeActionTest.kt index 3d2ecac28a..8d0949353b 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleBlockModeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleBlockModeActionTest.kt @@ -12,10 +12,10 @@ package org.jetbrains.plugins.ideavim.action.motion.visual import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class VisualToggleBlockModeActionTest : VimTestCase() { +class VisualToggleBlockModeActionTest : VimTestCaseBase() { @Test fun `test enter visual with count`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleCharacterModeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleCharacterModeActionTest.kt index 4bf7b34aa2..c2d69f5fa7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleCharacterModeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleCharacterModeActionTest.kt @@ -14,11 +14,11 @@ import com.maddyhome.idea.vim.helper.vimSelectionStart import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.rangeOf import org.junit.jupiter.api.Test -class VisualToggleCharacterModeActionTest : VimTestCase() { +class VisualToggleCharacterModeActionTest : VimTestCaseBase() { @Test fun `test vim start after enter visual`() { val before = """ diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleLineModeActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleLineModeActionTest.kt index a2f800b82a..4c93fa627e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleLineModeActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/motion/visual/VisualToggleLineModeActionTest.kt @@ -12,10 +12,10 @@ package org.jetbrains.plugins.ideavim.action.motion.visual import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class VisualToggleLineModeActionTest : VimTestCase() { +class VisualToggleLineModeActionTest : VimTestCaseBase() { @Test fun `test enter visual with count`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollColumnLeftActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollColumnLeftActionTest.kt index 638c1dc60f..cc3b9a26f5 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollColumnLeftActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollColumnLeftActionTest.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -20,7 +20,7 @@ zl Move the view on the text [count] characters to the right, thus scroll the text [count] characters to the left. This only works when 'wrap' is off. */ -class ScrollColumnLeftActionTest : VimTestCase() { +class ScrollColumnLeftActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.DIFFERENT) @Test fun`test scrolls column to left`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollColumnRightActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollColumnRightActionTest.kt index f9f955713a..f2b40e9965 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollColumnRightActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollColumnRightActionTest.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -20,7 +20,7 @@ zh Move the view on the text [count] characters to the left, thus scroll the text [count] characters to the right. This only works when 'wrap' is off. */ -class ScrollColumnRightActionTest : VimTestCase() { +class ScrollColumnRightActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun`test scrolls column to right`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenColumnActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenColumnActionTest.kt index 28163feeca..d4b3c8ce47 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenColumnActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenColumnActionTest.kt @@ -11,7 +11,7 @@ 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.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.math.roundToInt import kotlin.test.assertEquals @@ -22,7 +22,7 @@ zs Scroll the text horizontally to position the cursor at the start (left side) of the screen. This only works when 'wrap' is off. */ -class ScrollFirstScreenColumnActionTest : VimTestCase() { +class ScrollFirstScreenColumnActionTest : VimTestCaseBase() { @Test fun `test scroll caret column to first screen column`() { configureByColumns(200) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLineActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLineActionTest.kt index 4c313fd2a8..1065c663ef 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLineActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLineActionTest.kt @@ -9,7 +9,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -17,7 +17,7 @@ import org.junit.jupiter.api.Test zt Like "z", but leave the cursor in the same column. */ -class ScrollFirstScreenLineActionTest : VimTestCase() { +class ScrollFirstScreenLineActionTest : VimTestCaseBase() { @Test fun `test scroll current line to top of screen`() { configureByPages(5) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLinePageStartActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLinePageStartActionTest.kt index e32a290605..bbf0acef7e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLinePageStartActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLinePageStartActionTest.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -21,7 +21,7 @@ z+ Without [count]: Redraw with the line just below the that line, at the first non-blank in the line. With [count]: just like "z". */ -class ScrollFirstScreenLinePageStartActionTest : VimTestCase() { +class ScrollFirstScreenLinePageStartActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun `test scrolls first line on next page to top of screen`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLineStartActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLineStartActionTest.kt index 4f998fab4b..d5bd986716 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLineStartActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollFirstScreenLineStartActionTest.kt @@ -9,7 +9,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -18,7 +18,7 @@ z Redraw, line [count] at top of window (default cursor line). Put cursor at first non-blank in the line. */ -class ScrollFirstScreenLineStartActionTest : VimTestCase() { +class ScrollFirstScreenLineStartActionTest : VimTestCaseBase() { @Test fun `test scroll current line to top of screen`() { configureByPages(5) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfPageDownActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfPageDownActionTest.kt index 0f653925ba..8328e0cdfb 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfPageDownActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfPageDownActionTest.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -28,7 +28,7 @@ CTRL-D Scroll window Downwards in the buffer. The number of the buffer nothing happens and a beep is produced. See also 'startofline' option. */ -class ScrollHalfPageDownActionTest : VimTestCase() { +class ScrollHalfPageDownActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun `test scroll half window downwards keeps cursor on same relative line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfPageUpActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfPageUpActionTest.kt index cdd3fbcdba..b9ee293c74 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfPageUpActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfPageUpActionTest.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -28,7 +28,7 @@ CTRL-U Scroll window Upwards in the buffer. The number of line of the buffer nothing happens and a beep is produced. See also 'startofline' option. */ -class ScrollHalfPageUpActionTest : VimTestCase() { +class ScrollHalfPageUpActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun `test scroll half window upwards keeps cursor on same relative line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfWidthLeftActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfWidthLeftActionTest.kt index c9db65c4ab..2bc05ea5f7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfWidthLeftActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfWidthLeftActionTest.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -27,7 +27,7 @@ zH Move the view on the text half a screenwidth to the [count] is used but undocumented. */ -class ScrollHalfWidthLeftActionTest : VimTestCase() { +class ScrollHalfWidthLeftActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun `test scroll half page width`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfWidthRightActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfWidthRightActionTest.kt index 99e0f8d2b4..c6981fb163 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfWidthRightActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollHalfWidthRightActionTest.kt @@ -10,7 +10,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -26,7 +26,7 @@ zH Move the view on the text half a screenwidth to the [count] is used but undocumented. */ -class ScrollHalfWidthRightActionTest : VimTestCase() { +class ScrollHalfWidthRightActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun `test scroll half page width`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenColumnActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenColumnActionTest.kt index 9f3fcaad54..6666be212a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenColumnActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenColumnActionTest.kt @@ -10,7 +10,7 @@ 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.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.math.roundToInt import kotlin.test.assertEquals @@ -21,7 +21,7 @@ ze Scroll the text horizontally to position the cursor at the end (right side) of the screen. This only works when 'wrap' is off. */ -class ScrollLastScreenColumnActionTest : VimTestCase() { +class ScrollLastScreenColumnActionTest : VimTestCaseBase() { @Test fun `test scroll caret column to last screen column`() { configureByColumns(200) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLineActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLineActionTest.kt index eddf02c0e8..a78ce8104c 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLineActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLineActionTest.kt @@ -8,14 +8,14 @@ package org.jetbrains.plugins.ideavim.action.scroll -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* *zb* zb Like "z-", but leave the cursor in the same column. */ -class ScrollLastScreenLineActionTest : VimTestCase() { +class ScrollLastScreenLineActionTest : VimTestCaseBase() { @Test fun `test scroll current line to bottom of screen`() { configureByPages(5) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLinePageStartActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLinePageStartActionTest.kt index f67f560c89..c2394896af 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLinePageStartActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLinePageStartActionTest.kt @@ -10,7 +10,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -24,7 +24,7 @@ z^ Without [count]: Redraw with the line just above the bottom of the window. Put the cursor in that line, at the first non-blank in the line. */ -class ScrollLastScreenLinePageStartActionTest : VimTestCase() { +class ScrollLastScreenLinePageStartActionTest : VimTestCaseBase() { @Test fun `test scrolls last line on previous page to bottom of screen`() { configureByPages(5) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLineStartActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLineStartActionTest.kt index c0b87ebf0a..cfdf16e41f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLineStartActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLastScreenLineStartActionTest.kt @@ -8,7 +8,7 @@ package org.jetbrains.plugins.ideavim.action.scroll -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -17,7 +17,7 @@ z- Redraw, line [count] at bottom of window (default cursor line). Put cursor at first non-blank in the line. */ -class ScrollLastScreenLineStartActionTest : VimTestCase() { +class ScrollLastScreenLineStartActionTest : VimTestCaseBase() { @Test fun `test scroll current line to bottom of screen`() { configureByPages(5) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLineDownActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLineDownActionTest.kt index 5c247c10c0..272cb83753 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLineDownActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLineDownActionTest.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -20,7 +20,7 @@ CTRL-E Scroll window [count] lines downwards in the buffer. The text moves upwards on the screen. Mnemonic: Extra lines. */ -class ScrollLineDownActionTest : VimTestCase() { +class ScrollLineDownActionTest : VimTestCaseBase() { @Test fun `test scroll single line down`() { configureByPages(5) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLineUpActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLineUpActionTest.kt index cab1d9e99f..7b36eb78c2 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLineUpActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollLineUpActionTest.kt @@ -10,7 +10,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -20,7 +20,7 @@ CTRL-Y Scroll window [count] lines upwards in the buffer. Note: When using the MS-Windows key bindings CTRL-Y is remapped to redo. */ -class ScrollLineUpActionTest : VimTestCase() { +class ScrollLineUpActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun `test scroll single line up`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollMiddleScreenLineActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollMiddleScreenLineActionTest.kt index f2e35e5a27..3beadbb23f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollMiddleScreenLineActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollMiddleScreenLineActionTest.kt @@ -9,7 +9,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -18,7 +18,7 @@ zz Like "z.", but leave the cursor in the same column. Careful: If caps-lock is on, this command becomes "ZZ": write buffer and exit! */ -class ScrollMiddleScreenLineActionTest : VimTestCase() { +class ScrollMiddleScreenLineActionTest : VimTestCaseBase() { @Test fun `test scrolls current line to middle of screen`() { configureByPages(5) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollMiddleScreenLineStartActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollMiddleScreenLineStartActionTest.kt index 261fa942f7..1463585fac 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollMiddleScreenLineStartActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollMiddleScreenLineStartActionTest.kt @@ -9,7 +9,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -18,7 +18,7 @@ z. Redraw, line [count] at center of window (default cursor line). Put cursor at first non-blank in the line. */ -class ScrollMiddleScreenLineStartActionTest : VimTestCase() { +class ScrollMiddleScreenLineStartActionTest : VimTestCaseBase() { @Test fun `test scrolls current line to middle of screen`() { configureByPages(5) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollPageDownActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollPageDownActionTest.kt index 1986ff3b9c..7f974553c9 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollPageDownActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollPageDownActionTest.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -25,7 +25,7 @@ CTRL-F Scroll window [count] pages Forwards (downwards) in move window one page down *i_* move window one page down *i_* */ -class ScrollPageDownActionTest : VimTestCase() { +class ScrollPageDownActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun `test scroll single page down with S-Down`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollPageUpActionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollPageUpActionTest.kt index d2a52c8382..31280554d8 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollPageUpActionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/action/scroll/ScrollPageUpActionTest.kt @@ -10,7 +10,7 @@ package org.jetbrains.plugins.ideavim.action.scroll import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /* @@ -24,7 +24,7 @@ CTRL-B Scroll window [count] pages Backwards (upwards) in the move window one page up *i_* move window one page up *i_* */ -class ScrollPageUpActionTest : VimTestCase() { +class ScrollPageUpActionTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.SCROLL) @Test fun `test scroll single page up with S-Up`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/command/VimShowModeTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/command/VimShowModeTest.kt index 5852739e26..fdd933cea2 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/command/VimShowModeTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/command/VimShowModeTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.command import com.intellij.openapi.wm.WindowManager import com.maddyhome.idea.vim.ui.widgets.mode.ModeWidgetFactory import com.maddyhome.idea.vim.ui.widgets.mode.VimModeWidget -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase // TODO it would be cool to test widget, but status bar is not initialized -class VimShowModeTest : VimTestCase() { +class VimShowModeTest : VimTestCaseBase() { // @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) // @Test // fun `test status string in normal`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/common/editor/VimEditorTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/common/editor/VimEditorTest.kt index 145eb2c6b5..337cd421fc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/common/editor/VimEditorTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/common/editor/VimEditorTest.kt @@ -13,10 +13,10 @@ import com.intellij.openapi.command.WriteCommandAction import com.maddyhome.idea.vim.newapi.IjVimEditor import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class VimEditorTest : VimTestCase() { +class VimEditorTest : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) @Test fun `test delete string`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/AddressTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/AddressTest.kt index 2edab0230c..5b18c6cdca 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/AddressTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/AddressTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.ex import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class AddressTest : VimTestCase() { +class AddressTest : VimTestCaseBase() { @Test fun testNoRange() { configureByText("1\n2\n3\n4\n5\n") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/CommandParserTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/CommandParserTest.kt index 9906394c63..01a974bbdf 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/CommandParserTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/CommandParserTest.kt @@ -24,13 +24,13 @@ import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser import com.maddyhome.idea.vim.vimscript.parser.errors.IdeavimErrorListener import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class CommandParserTest : VimTestCase() { +class CommandParserTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.UNCLEAR, "Caret different position") @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/ExEntryTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/ExEntryTest.kt index 073d8d5759..4d6b7084bd 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/ExEntryTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/ExEntryTest.kt @@ -17,7 +17,7 @@ import com.maddyhome.idea.vim.ui.ex.ExEntryPanel import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -34,7 +34,7 @@ import kotlin.test.fail // or literal, etc. should have individual test classes in the ideavim.ex.action package // :cmap should also be tested separately -class ExEntryTest : VimTestCase() { +class ExEntryTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/LongerScriptTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/LongerScriptTest.kt index 89956e921e..ec8da33b71 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/LongerScriptTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/LongerScriptTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser import com.maddyhome.idea.vim.vimscript.parser.errors.IdeavimErrorListener -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.system.measureTimeMillis // todo time limit -class LongerScriptTest : VimTestCase() { +class LongerScriptTest : VimTestCaseBase() { // it's always broken somehow @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/MultipleCaretsTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/MultipleCaretsTest.kt index 57e7a06dde..5c897fc924 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/MultipleCaretsTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/MultipleCaretsTest.kt @@ -10,13 +10,12 @@ package org.jetbrains.plugins.ideavim.ex import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.common.TextRange -import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.options.OptionConstants import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.VimOption import org.junit.jupiter.api.Disabled @@ -24,7 +23,7 @@ import org.junit.jupiter.api.Test import kotlin.test.assertContains import kotlin.test.assertNotNull -class MultipleCaretsTest : VimTestCase() { +class MultipleCaretsTest : VimTestCaseBase() { @Test fun testGotoToNthCharacter() { val before = "qwe rty a${c}sd\n fgh zx${c}c ${c}vbn" @@ -128,9 +127,7 @@ class MultipleCaretsTest : VimTestCase() { """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister() - .storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) typeText(commandToKeys("pu")) val after = """ qwe @@ -163,9 +160,7 @@ class MultipleCaretsTest : VimTestCase() { """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister() - .storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) typeText(commandToKeys("pu")) val after = """ qwe @@ -199,9 +194,7 @@ class MultipleCaretsTest : VimTestCase() { """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister() - .storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) typeText(commandToKeys("4pu")) val after = """ qwe @@ -235,9 +228,7 @@ class MultipleCaretsTest : VimTestCase() { """.trimIndent() val editor = configureByText(before) - val vimEditor = editor.vim - VimPlugin.getRegister() - .storeText(vimEditor, vimEditor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) typeText(commandToKeys("4pu")) val after = """ qwe @@ -257,8 +248,7 @@ class MultipleCaretsTest : VimTestCase() { fun testPutVisualLines() { val before = "${c}qwe\n" + "rty\n" + "as${c}d\n" + "fgh\n" + "zxc\n" + "vbn\n" val editor = configureByText(before) - VimPlugin.getRegister() - .storeText(editor.vim, editor.vim.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) + VimPlugin.getRegister().storeText(editor, editor.primaryCaret(), TextRange(16, 19), SelectionType.CHARACTER_WISE, false) typeText("vj") typeText(commandToKeys("pu")) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/LongerFunctionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/LongerFunctionTest.kt index fee026bdcb..7457c9b26e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/LongerFunctionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/LongerFunctionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class LongerFunctionTest : VimTestCase() { +class LongerFunctionTest : VimTestCaseBase() { val script = """ function! IsUppercase(char) return a:char >=# 'A' && a:char <=# 'Z' diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ActionCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ActionCommandTest.kt index c17772d328..b2b073e44a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ActionCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ActionCommandTest.kt @@ -11,14 +11,14 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class ActionCommandTest : VimTestCase() { +class ActionCommandTest : VimTestCaseBase() { // VIM-652 |:action| @TestWithoutNeovim(SkipNeovimReason.ACTION_COMMAND) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ActionListCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ActionListCommandTest.kt index c5a2ecccc9..5213481936 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ActionListCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ActionListCommandTest.kt @@ -10,13 +10,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.intellij.openapi.actionSystem.ActionManager import com.intellij.util.ArrayUtil import com.maddyhome.idea.vim.ex.ExOutputModel.Companion.getInstance -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import java.util.* import kotlin.test.assertNotNull @Suppress("SpellCheckingInspection") -class ActionListCommandTest : VimTestCase() { +class ActionListCommandTest : VimTestCaseBase() { @Test fun testListAllActions() { configureByText("\n") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ArgumentCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ArgumentCommandTest.kt index fe2f504229..3fb8682593 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ArgumentCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ArgumentCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.SelectFileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class ArgumentCommandTest : VimTestCase() { +class ArgumentCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("argument 42") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/AsciiCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/AsciiCommandTest.kt index e0a37b0a67..d38ef68373 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/AsciiCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/AsciiCommandTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.VimPlugin -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class AsciiCommandTest : VimTestCase() { +class AsciiCommandTest : VimTestCaseBase() { @Test fun `test shows ascii value under caret`() { configureByText("${c}Hello world") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferCloseCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferCloseCommandTest.kt index 57cdf33cbf..280d98d331 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferCloseCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferCloseCommandTest.kt @@ -8,13 +8,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Michal Placek */ -class BufferCloseCommandTest : VimTestCase() { +class BufferCloseCommandTest : VimTestCaseBase() { @Test fun `test close file by bd command`() { val psiFile1 = fixture.configureByText("A_Discovery1", "Lorem ipsum dolor sit amet,") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferCommandTest.kt index 483235acaf..41efd3fa78 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferCommandTest.kt @@ -8,13 +8,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author John Weigel */ -class BufferCommandTest : VimTestCase() { +class BufferCommandTest : VimTestCaseBase() { @Test fun testBufferActionByNumber() { configureByFileName("aaa.txt") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferListCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferListCommandTest.kt index 73305ab10e..d9284f0eda 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferListCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/BufferListCommandTest.kt @@ -10,13 +10,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.ex.ExOutputModel.Companion.getInstance -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author John Weigel */ -class BufferListCommandTest : VimTestCase() { +class BufferListCommandTest : VimTestCaseBase() { companion object { const val DEFAULT_LS_OUTPUT = " 1 %a \"/src/aaa.txt\" line: 1" } diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CallCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CallCommandTest.kt index 801c66d8c4..2361f6d010 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CallCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CallCommandTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class CallCommandTest : VimTestCase() { +class CallCommandTest : VimTestCaseBase() { @Test fun `test call command`() { val function = """ diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ClearJumpsCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ClearJumpsCommandTest.kt index d3f0faa705..494241896f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ClearJumpsCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ClearJumpsCommandTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ClearJumpsCommandTest : VimTestCase() { +class ClearJumpsCommandTest : VimTestCaseBase() { @Test fun `test clear jumps`() { configureByText( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdClearCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdClearCommandTest.kt index 18c561deb6..5a6434e84b 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdClearCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdClearCommandTest.kt @@ -9,13 +9,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.VimPlugin -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Elliot Courant */ -class CmdClearCommandTest : VimTestCase() { +class CmdClearCommandTest : VimTestCaseBase() { @Test fun `test clear aliases`() { VimPlugin.getCommand().resetAliases() diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdCommandTest.kt index 7dfdddc46b..99843d57ca 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdCommandTest.kt @@ -10,13 +10,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Elliot Courant */ -class CmdCommandTest : VimTestCase() { +class CmdCommandTest : VimTestCaseBase() { @Test fun `test recursive`() { VimPlugin.getCommand().resetAliases() diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdFilterCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdFilterCommandTest.kt index 8f702ee215..f32404fde6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdFilterCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CmdFilterCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.CmdFilterCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class CmdFilterCommandTest : VimTestCase() { +class CmdFilterCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("!ls") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CopyCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CopyCommandTest.kt index 2ea407441b..bd349a492c 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CopyCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/CopyCommandTest.kt @@ -9,11 +9,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") -class CopyCommandTest : VimTestCase() { +class CopyCommandTest : VimTestCaseBase() { @Test fun `test duplicate line below`() { configureByText(""" @@ -36,7 +36,7 @@ class CopyCommandTest : VimTestCase() { originalVimAfter = """ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas efficitur nec odio vel malesuada. Nunc tincidunt viverra ligula non scelerisque. Aliquam erat volutpat. Praesent in fermentum orci. - Nunc tincidunt viverra ligula non ${c}scelerisque. Aliquam erat volutpat. Praesent in fermentum orci. + Nunc tincidunt viverra ligula non scelerisque. Aliquam erat volutpat. Praesent in fermentum orci. Fusce sit amet mi ut purus volutpat vulputate vitae sed tortor. Aliquam felis neque, varius eu accumsan vitae, facilisis ac nulla. """, @@ -68,7 +68,7 @@ class CopyCommandTest : VimTestCase() { @VimBehaviorDiffers( originalVimAfter = """ Fusce sit amet mi ut purus volutpat vulputate vitae sed tortor. Aliquam felis neque, varius eu - ${c}accumsan vitae, facilisis ac nulla. + accumsan vitae, facilisis ac nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas efficitur nec odio vel malesuada. Nunc tincidunt viverra ligula non scelerisque. Aliquam erat volutpat. Praesent in fermentum orci. Fusce sit amet mi ut purus volutpat vulputate vitae sed tortor. Aliquam felis neque, varius eu @@ -105,7 +105,7 @@ class CopyCommandTest : VimTestCase() { Fusce sit amet mi ut purus volutpat vulputate vitae sed tortor. Aliquam felis neque, varius eu accumsan vitae, facilisis ac nulla. Fusce sit amet mi ut purus volutpat vulputate vitae sed tortor. Aliquam felis neque, varius eu - ${c}accumsan vitae, facilisis ac nulla. + accumsan vitae, facilisis ac nulla. """, description = "Caret placement is incorrect", shouldBeFixed = true @@ -138,7 +138,7 @@ class CopyCommandTest : VimTestCase() { Fusce sit amet mi ut purus volutpat vulputate vitae sed tortor. Aliquam felis neque, varius eu accumsan vitae, facilisis ac nulla. Fusce sit amet mi ut purus volutpat vulputate vitae sed tortor. Aliquam felis neque, varius eu - ${c}accumsan vitae, facilisis ac nulla. + accumsan vitae, facilisis ac nulla. """, description = "Caret placement is incorrect", shouldBeFixed = true @@ -172,7 +172,7 @@ class CopyCommandTest : VimTestCase() { Fusce sit amet mi ut purus volutpat vulputate vitae sed tortor. Aliquam felis neque, varius eu accumsan vitae, facilisis ac nulla. Fusce sit amet mi ut purus volutpat vulputate vitae sed tortor. Aliquam felis neque, varius eu - ${c}accumsan vitae, facilisis ac nulla. + accumsan vitae, facilisis ac nulla. """, description = "Caret placement is wrong", shouldBeFixed = true diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DelCmdCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DelCmdCommandTest.kt index 2689e44118..20028514dc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DelCmdCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DelCmdCommandTest.kt @@ -9,13 +9,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.VimPlugin -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Elliot Courant */ -class DelCmdCommandTest : VimTestCase() { +class DelCmdCommandTest : VimTestCaseBase() { @Test fun `test remove alias`() { VimPlugin.getCommand().resetAliases() diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DeleteLinesCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DeleteLinesCommandTest.kt index 282517031a..b520edacf2 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DeleteLinesCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DeleteLinesCommandTest.kt @@ -8,11 +8,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") -class DeleteLinesCommandTest : VimTestCase() { +class DeleteLinesCommandTest : VimTestCaseBase() { @Test fun `test delete command without range`() { configureByText(""" diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DeleteMarksCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DeleteMarksCommandTest.kt index 1bd9686b8d..e606b1a58c 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DeleteMarksCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DeleteMarksCommandTest.kt @@ -12,7 +12,7 @@ import com.intellij.openapi.editor.LogicalPosition import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.mark.Mark import com.maddyhome.idea.vim.newapi.vim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertNotNull import kotlin.test.assertNull @@ -20,7 +20,7 @@ import kotlin.test.assertNull /** * @author Jørgen Granseth */ -class DeleteMarksCommandTest : VimTestCase() { +class DeleteMarksCommandTest : VimTestCaseBase() { private fun setUpMarks(marks: String) { configureByText( """Lorem ipsum dolor sit amet, diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DelfunctionCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DelfunctionCommandTest.kt index 34fedb3794..2867ae34af 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DelfunctionCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DelfunctionCommandTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class DelfunctionCommandTest : VimTestCase() { +class DelfunctionCommandTest : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN_ERROR) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DigraphsCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DigraphsCommandTest.kt index 92cce3cc76..5d34499211 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DigraphsCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/DigraphsCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.DigraphCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test -class DigraphsCommandTest : VimTestCase() { +class DigraphsCommandTest : VimTestCaseBase() { @Test fun `test digraphs is parsed correctly`() { val exCommand = injector.vimscriptParser.parseCommand("digraphs") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/EchoCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/EchoCommandTest.kt index b7540bb0bf..745271dd09 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/EchoCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/EchoCommandTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class EchoCommandTest : VimTestCase() { +class EchoCommandTest : VimTestCaseBase() { @Test fun `test echo with a string`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/EditFileCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/EditFileCommandTest.kt index 3de4769882..64bff5945a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/EditFileCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/EditFileCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.EditFileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class EditFileCommandTest : VimTestCase() { +class EditFileCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("edit ~/.ideavimrc") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ExecuteCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ExecuteCommandTest.kt index 4039179915..8927abe37d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ExecuteCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ExecuteCommandTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ExecuteCommandTest : VimTestCase() { +class ExecuteCommandTest : VimTestCaseBase() { @Test fun `test execute with one expression`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ExitCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ExitCommandTest.kt index cf85506e2c..f02d0632c6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ExitCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ExitCommandTest.kt @@ -8,13 +8,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class ExitCommandTest : VimTestCase() { +class ExitCommandTest : VimTestCaseBase() { @Test fun `test single file`() { setupChecks { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FileCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FileCommandTest.kt index ba65095a02..b3a1807ff6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FileCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FileCommandTest.kt @@ -11,12 +11,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.FileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertContains import kotlin.test.assertTrue -class FileCommandTest : VimTestCase() { +class FileCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("file") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FindCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FindCommandTest.kt index 3d94c0f0bf..c46cbc142f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FindCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FindCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.FindFileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class FindCommandTest : VimTestCase() { +class FindCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("find README.md") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FirstCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FirstCommandTest.kt index 3aca4e0607..99c4700842 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FirstCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FirstCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.SelectFirstFileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class FirstCommandTest : VimTestCase() { +class FirstCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("first") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GlobalCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GlobalCommandTest.kt index 865d52b959..a0e8bbac66 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GlobalCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GlobalCommandTest.kt @@ -16,10 +16,10 @@ import com.maddyhome.idea.vim.history.HistoryConstants import com.maddyhome.idea.vim.newapi.vim import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class GlobalCommandTest : VimTestCase() { +class GlobalCommandTest : VimTestCaseBase() { companion object { private val initialText = """ A Discovery diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GotoCharacterCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GotoCharacterCommandTest.kt index 6eb436ff89..2545a1b999 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GotoCharacterCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GotoCharacterCommandTest.kt @@ -10,13 +10,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.GotoCharacterCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue @Suppress("SpellCheckingInspection") -class GotoCharacterCommandTest : VimTestCase() { +class GotoCharacterCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("goto 10") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GotoLineCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GotoLineCommandTest.kt index 6cd4822ee9..9b74cc3e47 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GotoLineCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/GotoLineCommandTest.kt @@ -11,13 +11,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.VimPlugin import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull @Suppress("SpellCheckingInspection") -class GotoLineCommandTest : VimTestCase() { +class GotoLineCommandTest : VimTestCaseBase() { @Test fun `test goto explicit line`() { val before = """ diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/HelpCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/HelpCommandTest.kt index 498526d227..a6b2fb6be4 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/HelpCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/HelpCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.HelpCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class HelpCommandTest : VimTestCase() { +class HelpCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("help :help") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/JoinLinesCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/JoinLinesCommandTest.kt index 04ad8b5742..6c93118a32 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/JoinLinesCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/JoinLinesCommandTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class JoinLinesCommandTest : VimTestCase() { +class JoinLinesCommandTest : VimTestCaseBase() { @Test fun `test simple join`() { doTest( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/JumpsCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/JumpsCommandTest.kt index 700f215254..1d2d219788 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/JumpsCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/JumpsCommandTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class JumpsCommandTest : VimTestCase() { +class JumpsCommandTest : VimTestCaseBase() { @Test fun `test shows empty list`() { configureByText("") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LastCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LastCommandTest.kt index 4ffa7e43ec..68ad72857a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LastCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LastCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.SelectLastFileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class LastCommandTest : VimTestCase() { +class LastCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("last") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LetCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LetCommandTest.kt index 4ff147f595..bb708eaf7a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LetCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LetCommandTest.kt @@ -17,7 +17,7 @@ import com.maddyhome.idea.vim.options.OptionDeclaredScope import com.maddyhome.idea.vim.options.ToggleOption import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -25,7 +25,7 @@ import kotlin.test.assertEquals import kotlin.test.assertFalse import kotlin.test.assertTrue -class LetCommandTest : VimTestCase() { +class LetCommandTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LockVarCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LockVarCommandTest.kt index 1c00c1bc4b..5210ea7001 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LockVarCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LockVarCommandTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class LockVarCommandTest : VimTestCase() { +class LockVarCommandTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.PLUGIN_ERROR) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MapClearCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MapClearCommandTest.kt index a2108ee7fa..8c84763c6d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MapClearCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MapClearCommandTest.kt @@ -9,12 +9,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.command.MappingMode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class MapClearCommandTest : VimTestCase() { +class MapClearCommandTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MapCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MapCommandTest.kt index 159d80c881..d39c36557e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MapCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MapCommandTest.kt @@ -19,7 +19,7 @@ import org.jetbrains.plugins.ideavim.ExceptionHandler import org.jetbrains.plugins.ideavim.OnlyThrowLoggedErrorProcessor import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.exceptionMappingOwner import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Disabled @@ -32,7 +32,7 @@ import kotlin.test.assertTrue /** * @author vlan */ -class MapCommandTest : VimTestCase() { +class MapCommandTest : VimTestCaseBase() { @AfterEach fun tearDown() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MarkCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MarkCommandTest.kt index 9879d0e6cd..daf67d8f5a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MarkCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MarkCommandTest.kt @@ -10,14 +10,14 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.newapi.vim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.fail /** * @author Alex Plate */ -class MarkCommandTest : VimTestCase() { +class MarkCommandTest : VimTestCaseBase() { @Test fun `test simple mark`() { configureByText( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MarksCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MarksCommandTest.kt index 1f5065b622..3b566bafc4 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MarksCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MarksCommandTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.intellij.idea.TestFor import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.newapi.vim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MarksCommandTest : VimTestCase() { +class MarksCommandTest : VimTestCaseBase() { @Test @TestFor(issues = ["VIM-3176"]) fun `test gv after pasting to the same line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MoveCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MoveCommandTest.kt index 0de2469d7d..2294440f1e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MoveCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/MoveCommandTest.kt @@ -8,11 +8,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test @Suppress("SpellCheckingInspection") -class MoveCommandTest : VimTestCase() { +class MoveCommandTest : VimTestCaseBase() { @Test fun `test selection marks after moving line up`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NextFileCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NextFileCommandTest.kt index c08aaa237c..2aa935bf66 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NextFileCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NextFileCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.NextFileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class NextFileCommandTest : VimTestCase() { +class NextFileCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("next") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NohlsearchCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NohlsearchCommandTest.kt index f99727fddf..ab364c4183 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NohlsearchCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NohlsearchCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.NoHLSearchCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class NohlsearchCommandTest: VimTestCase() { +class NohlsearchCommandTest: VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("nohlsearch") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/OnlyCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/OnlyCommandTest.kt index 4b5e667c66..9d73c9389d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/OnlyCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/OnlyCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.OnlyCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class OnlyCommandTest : VimTestCase() { +class OnlyCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand(":only") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PackaddCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PackaddCommandTest.kt index 06d36f50a6..27f46d8924 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PackaddCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PackaddCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.PackaddCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class PackaddCommandTest : VimTestCase() { +class PackaddCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("packadd matchit") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PlugCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PlugCommandTest.kt index 1b10cc5797..5b12fcc0d6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PlugCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PlugCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.PlugCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class PlugCommandTest : VimTestCase() { +class PlugCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("Plug 'tpope/vim-commentary'") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PreviousFileCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PreviousFileCommandTest.kt index 5defab13fe..2bd375a1dc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PreviousFileCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PreviousFileCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.PreviousFileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class PreviousFileCommandTest : VimTestCase() { +class PreviousFileCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("Next 4") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PrintCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PrintCommandTest.kt index d34e2cacf1..2be1d0b942 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PrintCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PrintCommandTest.kt @@ -10,12 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.api.options -import com.maddyhome.idea.vim.ex.ExOutputModel import com.maddyhome.idea.vim.newapi.vim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class PrintCommandTest : VimTestCase() { +class PrintCommandTest : VimTestCaseBase() { @Test fun `test default range`() { configureByText(initialText) @@ -27,7 +26,7 @@ class PrintCommandTest : VimTestCase() { fun `test clears output between execution`() { configureByText(initialText) typeText(commandToKeys("p")) - assertExOutput(" Lorem Ipsum", clear = false) + assertExOutput(" Lorem Ipsum") // TODO: We need a better way to handle output // We should be waiting for a keypress now, such as or to close the output panel. But that's handled // by a separate key event loop which doesn't operate in tests. diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PutCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PutCommandTest.kt index 93ec2a2c87..93addb02ab 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PutCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PutCommandTest.kt @@ -9,13 +9,13 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ -class PutCommandTest : VimTestCase() { +class PutCommandTest : VimTestCaseBase() { // VIM-550 |:put| @Test fun `test put creates new line`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/QuitCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/QuitCommandTest.kt index 0847f9a657..6812b5eafc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/QuitCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/QuitCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.QuitCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class QuitCommandTest : VimTestCase() { +class QuitCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("quit") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RedoCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RedoCommandTest.kt index ea440c84fd..93ede1410f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RedoCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RedoCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.RedoCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class RedoCommandTest : VimTestCase() { +class RedoCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("redo") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RegistersCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RegistersCommandTest.kt index a6675771a6..375c6713d6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RegistersCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RegistersCommandTest.kt @@ -12,12 +12,12 @@ import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.register.Register import com.maddyhome.idea.vim.state.mode.SelectionType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.annotations.TestWithPrimaryClipboard import org.jetbrains.plugins.ideavim.annotations.TestWithoutPrimaryClipboard import org.junit.jupiter.api.Test -class RegistersCommandTest : VimTestCase() { +class RegistersCommandTest : VimTestCaseBase() { @TestWithoutPrimaryClipboard fun `test list empty registers`() { configureByText("") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RepeatCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RepeatCommandTest.kt index f8693e3e96..2ed76a63f8 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RepeatCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/RepeatCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.RepeatCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class RepeatCommandTest : VimTestCase() { +class RepeatCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("@:") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetCommandTest.kt index 432eef19a3..e0f076e995 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetCommandTest.kt @@ -14,7 +14,7 @@ import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.options.OptionAccessScope import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -23,7 +23,7 @@ import kotlin.test.assertFalse import kotlin.test.assertTrue @TestWithoutNeovim(reason = SkipNeovimReason.OPTION) -class SetCommandTest : VimTestCase() { +class SetCommandTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetHandlerCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetHandlerCommandTest.kt index 871da46695..77de3cd5f9 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetHandlerCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetHandlerCommandTest.kt @@ -15,10 +15,10 @@ import com.maddyhome.idea.vim.key.ShortcutOwnerInfo import com.maddyhome.idea.vim.vimscript.model.commands.SetHandlerCommand import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SetHandlerCommandTest : VimTestCase() { +class SetHandlerCommandTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.NOT_VIM_TESTING) @Test fun `test parse a mappings`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetglobalCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetglobalCommandTest.kt index 599bf36f71..102775df1d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetglobalCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetglobalCommandTest.kt @@ -16,7 +16,7 @@ import com.maddyhome.idea.vim.options.ToggleOption import com.maddyhome.idea.vim.vimscript.model.commands.SetglobalCommand import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -24,7 +24,7 @@ import kotlin.test.assertEquals import kotlin.test.assertTrue @TestWithoutNeovim(reason = SkipNeovimReason.OPTION) -class SetglobalCommandTest : VimTestCase() { +class SetglobalCommandTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetlocalCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetlocalCommandTest.kt index 5a7008188e..ffecf41c84 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetlocalCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SetlocalCommandTest.kt @@ -16,7 +16,7 @@ import com.maddyhome.idea.vim.options.ToggleOption import com.maddyhome.idea.vim.vimscript.model.commands.SetlocalCommand import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -25,7 +25,7 @@ import kotlin.test.assertFalse import kotlin.test.assertTrue @TestWithoutNeovim(reason = SkipNeovimReason.OPTION) -class SetlocalCommandTest : VimTestCase() { +class SetlocalCommandTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ShellCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ShellCommandTest.kt index bc6f01e7ba..ceb29112ad 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ShellCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/ShellCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.ShellCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class ShellCommandTest : VimTestCase() { +class ShellCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("shell") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SortCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SortCommandTest.kt index e8ef235865..d3440f4c63 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SortCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SortCommandTest.kt @@ -11,14 +11,14 @@ import com.google.common.collect.Lists import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.MethodSource import javax.swing.KeyStroke @Suppress("SpellCheckingInspection") -class SortCommandTest : VimTestCase() { +class SortCommandTest : VimTestCaseBase() { private fun assertSort(testCase: TestCase) { val (content, visualSelect, sortCommand, expected) = testCase configureByText(content) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SourceCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SourceCommandTest.kt index 3f46a04d5e..031058b080 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SourceCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SourceCommandTest.kt @@ -15,7 +15,7 @@ import com.maddyhome.idea.vim.key.MappingInfo import com.maddyhome.idea.vim.key.MappingOwner import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.vimscript.model.commands.SourceCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import org.junit.jupiter.api.io.TempDir import java.io.File @@ -23,7 +23,7 @@ import kotlin.test.assertEquals import kotlin.test.assertNull import kotlin.test.assertTrue -class SourceCommandTest : VimTestCase() { +class SourceCommandTest : VimTestCaseBase() { @TempDir var tempDir: File? = null diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SplitCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SplitCommandTest.kt index b78fb75cee..782e6d4add 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SplitCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SplitCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.SplitCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class SplitCommandTest : VimTestCase() { +class SplitCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("split file") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SubstituteCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SubstituteCommandTest.kt index 171191c513..fe3cc9fef2 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SubstituteCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/SubstituteCommandTest.kt @@ -12,7 +12,7 @@ import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @@ -22,7 +22,7 @@ import org.junit.jupiter.api.Disabled * @author Alex Plate */ @TraceOptions(TestOptionConstants.smartcase, TestOptionConstants.ignorecase) -class SubstituteCommandTest : VimTestCase() { +class SubstituteCommandTest : VimTestCaseBase() { @OptionTest( VimOption(TestOptionConstants.smartcase, doesntAffectTest = true), VimOption(TestOptionConstants.ignorecase, doesntAffectTest = true), diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabPreviousCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabPreviousCommandTest.kt index f210192a6f..dfbdd55330 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabPreviousCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabPreviousCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.PreviousTabCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class TabPreviousCommandTest : VimTestCase() { +class TabPreviousCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("tabprevious") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabcloseCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabcloseCommandTest.kt index 5aeeb56d7f..380d92dc5e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabcloseCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabcloseCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.TabCloseCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class TabcloseCommandTest : VimTestCase() { +class TabcloseCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("tabclose") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabmoveCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabmoveCommandTest.kt index bb48cd8183..be6e80afc8 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabmoveCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabmoveCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.TabMoveCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class TabmoveCommandTest : VimTestCase() { +class TabmoveCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("tabmove 42") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabnextCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabnextCommandTest.kt index ddfea52345..a19452b7a1 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabnextCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabnextCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.NextTabCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class TabnextCommandTest : VimTestCase() { +class TabnextCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("tabnext") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabonlyCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabonlyCommandTest.kt index 2ce4be2b09..25c71a73bd 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabonlyCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/TabonlyCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.TabOnlyCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class TabonlyCommandTest : VimTestCase() { +class TabonlyCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("tabonly") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UnMapCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UnMapCommandTest.kt index 8d667decdf..bb507349d0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UnMapCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UnMapCommandTest.kt @@ -9,12 +9,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.command.MappingMode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class UnMapCommandTest : VimTestCase() { +class UnMapCommandTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UndoCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UndoCommandTest.kt index 5e80d9a4cb..dcfadb98c6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UndoCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UndoCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.UndoCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class UndoCommandTest : VimTestCase() { +class UndoCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("undo") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UnlockvarCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UnlockvarCommandTest.kt index 4f49661289..4a5d4703f3 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UnlockvarCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/UnlockvarCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.UnlockVarCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class UnlockvarCommandTest : VimTestCase() { +class UnlockvarCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("unlockvar myvar") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteAllCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteAllCommandTest.kt index a3bb3cbba3..c4f8f9a0d7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteAllCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteAllCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.WriteAllCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class WriteAllCommandTest : VimTestCase() { +class WriteAllCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("wall") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteCommandTest.kt index 3313486e44..7bbb381a78 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.WriteCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class WriteCommandTest : VimTestCase() { +class WriteCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("write") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteNextCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteNextCommandTest.kt index ad7d17063c..4c27083590 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteNextCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WriteNextCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.WriteNextFileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class WriteNextCommandTest : VimTestCase() { +class WriteNextCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("wnext 42") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WritePreviousCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WritePreviousCommandTest.kt index 3c9ca7d2a0..8ae790e0c2 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WritePreviousCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WritePreviousCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.WritePreviousFileCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class WritePreviousCommandTest : VimTestCase() { +class WritePreviousCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("wprevious 42") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WritequitCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WritequitCommandTest.kt index 49984b40d3..a2aaa86ac7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WritequitCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/WritequitCommandTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.commands.WriteQuitCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue -class WritequitCommandTest : VimTestCase() { +class WritequitCommandTest : VimTestCaseBase() { @Test fun `command parsing`() { val command = injector.vimscriptParser.parseCommand("exit") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/YankLinesCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/YankLinesCommandTest.kt index ac25fb0597..e57266172f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/YankLinesCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/YankLinesCommandTest.kt @@ -11,12 +11,12 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.register.RegisterConstants -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals @Suppress("SpellCheckingInspection") -class YankLinesCommandTest : VimTestCase() { +class YankLinesCommandTest : VimTestCaseBase() { @Test fun `test yank current line with default range`() { configureByText( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/CurlyBracesNameTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/CurlyBracesNameTest.kt index b3698e6cff..db31165aef 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/CurlyBracesNameTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/CurlyBracesNameTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.expressions -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class CurlyBracesNameTest : VimTestCase() { +class CurlyBracesNameTest : VimTestCaseBase() { @Test fun `test name with expression`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/DictionaryElementByKeyTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/DictionaryElementByKeyTest.kt index 73b8f3d30a..7b4879d028 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/DictionaryElementByKeyTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/DictionaryElementByKeyTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.expressions -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class DictionaryElementByKeyTest : VimTestCase() { +class DictionaryElementByKeyTest : VimTestCaseBase() { @Test fun `test get element by key`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/ExpressionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/ExpressionTest.kt index 23230de118..f613031329 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/ExpressionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/ExpressionTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.expressions import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.vimscript.model.expressions.Register -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.ex.evaluate import org.junit.jupiter.api.Test -class ExpressionTest : VimTestCase() { +class ExpressionTest : VimTestCaseBase() { @Test fun `test multiline register content`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/FunctionCallTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/FunctionCallTest.kt index b844dbaa14..96173fb098 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/FunctionCallTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/FunctionCallTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.expressions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class FunctionCallTest : VimTestCase() { +class FunctionCallTest : VimTestCaseBase() { @Test fun `test function as method call`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/LambdaTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/LambdaTest.kt index c7a0a006a7..adc477059d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/LambdaTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/LambdaTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.expressions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class LambdaTest : VimTestCase() { +class LambdaTest : VimTestCaseBase() { @Test fun `test lambda with no args`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/OptionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/OptionTest.kt index 0db84cd303..8519fee17a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/OptionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/OptionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.expressions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class OptionTest : VimTestCase() { +class OptionTest : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.OPTION) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/SublistExpressionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/SublistExpressionTest.kt index ca21c2118a..1f582d37d0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/SublistExpressionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/expressions/SublistExpressionTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.expressions -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SublistExpressionTest : VimTestCase() { +class SublistExpressionTest : VimTestCaseBase() { @Test fun `test strung sublist`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/AnonymousFunctionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/AnonymousFunctionTest.kt index 9b986188dc..c473194f7a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/AnonymousFunctionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/AnonymousFunctionTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.functions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class AnonymousFunctionTest : VimTestCase() { +class AnonymousFunctionTest : VimTestCaseBase() { @Test fun `test anonymous function`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/BasicStringFunctions.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/BasicStringFunctions.kt index bffd6159cb..e69918d051 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/BasicStringFunctions.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/BasicStringFunctions.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.functions -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class BasicStringFunctions : VimTestCase() { +class BasicStringFunctions : VimTestCaseBase() { @Test fun `test toupper`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/BuiltInFunctionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/BuiltInFunctionTest.kt index afafdbb990..c70df8adf2 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/BuiltInFunctionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/BuiltInFunctionTest.kt @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.functions import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class BuiltInFunctionTest : VimTestCase() { +class BuiltInFunctionTest : VimTestCaseBase() { @Test fun `test abs`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/DictionaryFunctionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/DictionaryFunctionTest.kt index d7fc7dc092..32eee160d4 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/DictionaryFunctionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/DictionaryFunctionTest.kt @@ -10,11 +10,11 @@ package org.jetbrains.plugins.ideavim.ex.implementation.functions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class DictionaryFunctionTest : VimTestCase() { +class DictionaryFunctionTest : VimTestCaseBase() { @Test fun `test self in dictionary function with assignment via function function`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/FuncrefTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/FuncrefTest.kt index 0a2d38f927..00591c831d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/FuncrefTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/FuncrefTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.functions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class FuncrefTest : VimTestCase() { +class FuncrefTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.PLUGIN_ERROR) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/FunctionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/FunctionTest.kt index d856cf119f..d55ee18404 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/FunctionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/FunctionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.functions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class FunctionTest : VimTestCase() { +class FunctionTest : VimTestCaseBase() { @Test fun `test function for built-in function`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/GetFunctionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/GetFunctionTest.kt index 996fa5677b..333e481e6f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/GetFunctionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/GetFunctionTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.functions -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class GetFunctionTest : VimTestCase() { +class GetFunctionTest : VimTestCaseBase() { @Test fun `test get with dictionary`() { configureByText("\n") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/HasFunctionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/HasFunctionTest.kt index 776c91d1a3..9f6bb176b5 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/HasFunctionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/HasFunctionTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.functions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class HasFunctionTest : VimTestCase() { +class HasFunctionTest : VimTestCaseBase() { @Test fun `test has for supported feature`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/SplitFunctionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/SplitFunctionTest.kt index 468576daeb..2cba972ddd 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/SplitFunctionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/functions/SplitFunctionTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.functions -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class SplitFunctionTest : VimTestCase() { +class SplitFunctionTest : VimTestCaseBase() { @Test fun `test split with default delimiter`() { configureByText("\n") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/services/VimVariableServiceTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/services/VimVariableServiceTest.kt index 540211b63c..e5236943cf 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/services/VimVariableServiceTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/services/VimVariableServiceTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.services -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class VimVariableServiceTest : VimTestCase() { +class VimVariableServiceTest : VimTestCaseBase() { @Test fun `test v count variable without count specified`() { configureByText("\n") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/ForTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/ForTest.kt index 6a98d9e08c..698251d1fd 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/ForTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/ForTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.statements import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class ForTest : VimTestCase() { +class ForTest : VimTestCaseBase() { @Test fun `test iterating over string`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/FunctionDeclarationTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/FunctionDeclarationTest.kt index 5c8cf39943..4b4db75fa8 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/FunctionDeclarationTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/FunctionDeclarationTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.statements import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class FunctionDeclarationTest : VimTestCase() { +class FunctionDeclarationTest : VimTestCaseBase() { @Test fun `test user defined function`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/IfStatementTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/IfStatementTest.kt index 8db975d1c2..de49e04f3a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/IfStatementTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/IfStatementTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.statements -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class IfStatementTest : VimTestCase() { +class IfStatementTest : VimTestCaseBase() { @Test fun `test simple if with true condition`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/TryCatchTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/TryCatchTest.kt index 158fc32d29..51f1a611b6 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/TryCatchTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/TryCatchTest.kt @@ -10,10 +10,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.statements import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class TryCatchTest : VimTestCase() { +class TryCatchTest : VimTestCaseBase() { @Test fun `test successful catch of a throw statement`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/WhileTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/WhileTest.kt index 32f55a7b73..9e39d86d46 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/WhileTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/statements/WhileTest.kt @@ -8,10 +8,10 @@ package org.jetbrains.plugins.ideavim.ex.implementation.statements -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class WhileTest : VimTestCase() { +class WhileTest : VimTestCaseBase() { @Test fun `test while`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/ExecutableTextRangesTests.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/ExecutableTextRangesTests.kt index ffb23d72ae..1638b8e9a0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/ExecutableTextRangesTests.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/ExecutableTextRangesTests.kt @@ -11,11 +11,11 @@ package org.jetbrains.plugins.ideavim.ex.parser import com.maddyhome.idea.vim.common.TextRange import com.maddyhome.idea.vim.vimscript.model.statements.IfStatement import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals -class ExecutableTextRangesTests : VimTestCase() { +class ExecutableTextRangesTests : VimTestCaseBase() { @Test fun `test regular script`() { val scriptString = """ diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/CmdFilterCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/CmdFilterCommandTest.kt index e03dbc11fa..771c2a971c 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/CmdFilterCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/CmdFilterCommandTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.ex.parser.commands import com.maddyhome.idea.vim.vimscript.model.commands.CmdFilterCommand import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class CmdFilterCommandTest : VimTestCase() { +class CmdFilterCommandTest : VimTestCaseBase() { // VIM-2442 @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/CommandTests.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/CommandTests.kt index b94293b0de..c155f0644f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/CommandTests.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/CommandTests.kt @@ -26,7 +26,7 @@ import com.maddyhome.idea.vim.vimscript.model.expressions.Scope import com.maddyhome.idea.vim.vimscript.model.expressions.SimpleExpression import com.maddyhome.idea.vim.vimscript.model.expressions.Variable import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.ex.evaluate import org.jetbrains.plugins.ideavim.productForArguments import org.junit.jupiter.api.Test @@ -36,7 +36,7 @@ import org.junit.jupiter.params.provider.MethodSource import kotlin.test.assertEquals import kotlin.test.assertTrue -class CommandTests : VimTestCase() { +class CommandTests : VimTestCaseBase() { companion object { @JvmStatic diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/GoToLineCommandParserTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/GoToLineCommandParserTest.kt index d66193d360..4a428ba3f4 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/GoToLineCommandParserTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/commands/GoToLineCommandParserTest.kt @@ -10,13 +10,13 @@ package org.jetbrains.plugins.ideavim.ex.parser.commands import com.maddyhome.idea.vim.vimscript.model.commands.GoToLineCommand import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertTrue // Note that this just tests that something like `:4` or `:14` is parsed as an instance of GoToLineCommand. // There are other tests elsewhere for the implementation of GoToLineCommand. -class GoToLineCommandParserTest : VimTestCase() { +class GoToLineCommandParserTest : VimTestCaseBase() { @Test fun `digit as go to line command`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/ForLoopTests.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/ForLoopTests.kt index 94c786af95..0f67f27e8c 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/ForLoopTests.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/ForLoopTests.kt @@ -15,7 +15,7 @@ import com.maddyhome.idea.vim.vimscript.model.expressions.Scope import com.maddyhome.idea.vim.vimscript.model.statements.loops.ForLoop import com.maddyhome.idea.vim.vimscript.model.statements.loops.ForLoopWithList import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.ex.evaluate import org.jetbrains.plugins.ideavim.productForArguments import org.junit.jupiter.params.ParameterizedTest @@ -24,7 +24,7 @@ import org.junit.jupiter.params.provider.MethodSource import kotlin.test.assertEquals import kotlin.test.assertTrue -class ForLoopTests : VimTestCase() { +class ForLoopTests : VimTestCaseBase() { companion object { @JvmStatic diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/FunctionDeclarationTests.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/FunctionDeclarationTests.kt index 2e154bf007..74f3eb4a90 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/FunctionDeclarationTests.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/FunctionDeclarationTests.kt @@ -15,7 +15,7 @@ import com.maddyhome.idea.vim.vimscript.model.statements.FunctionFlag import com.maddyhome.idea.vim.vimscript.model.statements.ReturnStatement import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser import com.maddyhome.idea.vim.vimscript.parser.errors.IdeavimErrorListener -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.productForArguments import org.junit.jupiter.api.Disabled import org.junit.jupiter.params.ParameterizedTest @@ -27,7 +27,7 @@ import kotlin.test.assertFalse import kotlin.test.assertNull import kotlin.test.assertTrue -class FunctionDeclarationTests : VimTestCase() { +class FunctionDeclarationTests : VimTestCaseBase() { companion object { @JvmStatic diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/IfStatementTests.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/IfStatementTests.kt index 2718861b7c..3fbd7e3ac3 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/IfStatementTests.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/IfStatementTests.kt @@ -10,7 +10,7 @@ package org.jetbrains.plugins.ideavim.ex.parser.statements import com.maddyhome.idea.vim.vimscript.model.statements.IfStatement import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.productForArguments import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.Arguments @@ -18,7 +18,7 @@ import org.junit.jupiter.params.provider.MethodSource import kotlin.test.assertEquals import kotlin.test.assertTrue -class IfStatementTests : VimTestCase() { +class IfStatementTests : VimTestCaseBase() { companion object { @JvmStatic diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/TryCatchTests.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/TryCatchTests.kt index d6010c7951..e1a4c6e24b 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/TryCatchTests.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/TryCatchTests.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.ex.parser.statements import com.maddyhome.idea.vim.vimscript.model.statements.ThrowStatement import com.maddyhome.idea.vim.vimscript.model.statements.TryStatement import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.productForArguments import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest @@ -22,7 +22,7 @@ import kotlin.test.assertNotNull import kotlin.test.assertNull import kotlin.test.assertTrue -class TryCatchTests : VimTestCase() { +class TryCatchTests : VimTestCaseBase() { companion object { @JvmStatic diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/WhileLoopTests.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/WhileLoopTests.kt index 71ef12ba2d..ed0b63fb1f 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/WhileLoopTests.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/parser/statements/WhileLoopTests.kt @@ -11,7 +11,7 @@ package org.jetbrains.plugins.ideavim.ex.parser.statements import com.maddyhome.idea.vim.vimscript.model.commands.EchoCommand import com.maddyhome.idea.vim.vimscript.model.statements.loops.WhileLoop import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.productForArguments import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.Arguments @@ -19,7 +19,7 @@ import org.junit.jupiter.params.provider.MethodSource import kotlin.test.assertEquals import kotlin.test.assertTrue -class WhileLoopTests : VimTestCase() { +class WhileLoopTests : VimTestCaseBase() { companion object { val values = listOf("", " ") diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/CommonExtensionTests.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/CommonExtensionTests.kt index 62d82183ae..26ead79b29 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/CommonExtensionTests.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/CommonExtensionTests.kt @@ -34,7 +34,7 @@ import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.options.OptionAccessScope import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -42,7 +42,7 @@ import org.junit.jupiter.api.TestInfo import kotlin.test.assertFalse import kotlin.test.assertTrue -class OpMappingTest : VimTestCase() { +class OpMappingTest : VimTestCaseBase() { private lateinit var extension: ExtensionBeanClass private var disposable: Disposable = Disposer.newDisposable() @@ -194,7 +194,7 @@ class OpMappingTest : VimTestCase() { } } -class PlugExtensionsTest : VimTestCase() { +class PlugExtensionsTest : VimTestCaseBase() { private lateinit var extension: ExtensionBeanClass @@ -238,7 +238,7 @@ class PlugExtensionsTest : VimTestCase() { } } -class PlugMissingKeysTest : VimTestCase() { +class PlugMissingKeysTest : VimTestCaseBase() { private lateinit var extension: ExtensionBeanClass diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/argtextobj/VimArgTextObjExtensionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/argtextobj/VimArgTextObjExtensionTest.kt index 5ef87a0e73..d45a6ce425 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/argtextobj/VimArgTextObjExtensionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/argtextobj/VimArgTextObjExtensionTest.kt @@ -11,14 +11,14 @@ import com.google.common.collect.Lists import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo import java.util.* @Suppress("SpellCheckingInspection") -class VimArgTextObjExtensionTest : VimTestCase() { +class VimArgTextObjExtensionTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/entiretextobj/VimTextObjEntireExtensionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/entiretextobj/VimTextObjEntireExtensionTest.kt index db6be36986..052d1aaf7d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/entiretextobj/VimTextObjEntireExtensionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/entiretextobj/VimTextObjEntireExtensionTest.kt @@ -13,7 +13,7 @@ import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -23,7 +23,7 @@ import java.util.* * @author Alexandre Grison (@agrison) */ @TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN) -class VimTextObjEntireExtensionTest : VimTestCase() { +class VimTextObjEntireExtensionTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/exchange/VimExchangeExtensionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/exchange/VimExchangeExtensionTest.kt index 8625c74fb4..6333a56d84 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/exchange/VimExchangeExtensionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/exchange/VimExchangeExtensionTest.kt @@ -13,12 +13,12 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.extension.exchange.VimExchangeExtension import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class VimExchangeExtensionTest : VimTestCase() { +class VimExchangeExtensionTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { @@ -83,7 +83,7 @@ class VimExchangeExtensionTest : VimTestCase() { // |X| @VimBehaviorDiffers( - originalVimAfter = "The ${c}brown catch over the lazy dog", + originalVimAfter = "The brown catch over the lazy dog", shouldBeFixed = true, ) @Test @@ -98,7 +98,7 @@ class VimExchangeExtensionTest : VimTestCase() { // |X| @VimBehaviorDiffers( - originalVimAfter = "The brown ${c}catch over the lazy dog", + originalVimAfter = "The brown catch over the lazy dog", shouldBeFixed = true, ) @Test @@ -116,7 +116,7 @@ class VimExchangeExtensionTest : VimTestCase() { originalVimAfter = """The quick catch over - ${c}brown fox + brown fox the lazy dog """, shouldBeFixed = true, @@ -144,7 +144,7 @@ class VimExchangeExtensionTest : VimTestCase() { originalVimAfter = """The quick catch over - ${c}brown fox + brown fox the lazy dog """, shouldBeFixed = true, @@ -198,7 +198,7 @@ class VimExchangeExtensionTest : VimTestCase() { """ catch over the lazy dog - ${c}The quick + The quick brown fox """, shouldBeFixed = true, diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/exchange/VimExchangeWithClipboardTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/exchange/VimExchangeWithClipboardTest.kt index dbeee9776d..7e1db6bee7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/exchange/VimExchangeWithClipboardTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/exchange/VimExchangeWithClipboardTest.kt @@ -14,7 +14,7 @@ import com.maddyhome.idea.vim.extension.exchange.VimExchangeExtension import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @@ -22,7 +22,7 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.TestInfo @TraceOptions(TestOptionConstants.clipboard) -class VimExchangeWithClipboardTest : VimTestCase() { +class VimExchangeWithClipboardTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { @@ -88,7 +88,7 @@ class VimExchangeWithClipboardTest : VimTestCase() { // |X| @OptionTest(VimOption(TestOptionConstants.clipboard, limitedValues = ["unnamed"])) @VimBehaviorDiffers( - originalVimAfter = "The ${c}brown catch over the lazy dog", + originalVimAfter = "The brown catch over the lazy dog", shouldBeFixed = true, ) fun `test visual exchange words from inside`() { @@ -103,7 +103,7 @@ class VimExchangeWithClipboardTest : VimTestCase() { // |X| @OptionTest(VimOption(TestOptionConstants.clipboard, limitedValues = ["unnamed"])) @VimBehaviorDiffers( - originalVimAfter = "The brown ${c}catch over the lazy dog", + originalVimAfter = "The brown catch over the lazy dog", shouldBeFixed = true, ) fun `test visual exchange words from outside`() { @@ -121,7 +121,7 @@ class VimExchangeWithClipboardTest : VimTestCase() { originalVimAfter = """The quick catch over - ${c}brown fox + brown fox the lazy dog """, shouldBeFixed = true, @@ -149,7 +149,7 @@ class VimExchangeWithClipboardTest : VimTestCase() { originalVimAfter = """The quick catch over - ${c}brown fox + brown fox the lazy dog """, shouldBeFixed = true, @@ -203,7 +203,7 @@ class VimExchangeWithClipboardTest : VimTestCase() { """ catch over the lazy dog - ${c}The quick + The quick brown fox """, shouldBeFixed = true, diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/highlightedyank/VimHighlightedYankTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/highlightedyank/VimHighlightedYankTest.kt index 0fb898878c..a9883ebbf5 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/highlightedyank/VimHighlightedYankTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/highlightedyank/VimHighlightedYankTest.kt @@ -13,7 +13,7 @@ import com.intellij.openapi.util.TextRange import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.extension.highlightedyank.DEFAULT_HIGHLIGHT_DURATION import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.assertHappened import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -22,7 +22,7 @@ import java.awt.Color import kotlin.test.assertEquals import kotlin.test.assertTrue -class VimHighlightedYankTest : VimTestCase() { +class VimHighlightedYankTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitCMakeTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitCMakeTest.kt index 8ee5f04ecc..b91c0a6981 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitCMakeTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitCMakeTest.kt @@ -8,12 +8,12 @@ package org.jetbrains.plugins.ideavim.extension.matchit -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class MatchitCMakeTest : VimTestCase() { +class MatchitCMakeTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitCTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitCTest.kt index 058f811fcb..1f8bafa3ae 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitCTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitCTest.kt @@ -8,12 +8,12 @@ package org.jetbrains.plugins.ideavim.extension.matchit -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class MatchitCTest : VimTestCase() { +class MatchitCTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitGNUMakeTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitGNUMakeTest.kt index f6af39e39e..22cff3caf7 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitGNUMakeTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitGNUMakeTest.kt @@ -8,12 +8,12 @@ package org.jetbrains.plugins.ideavim.extension.matchit -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class MatchitGNUMakeTest : VimTestCase() { +class MatchitGNUMakeTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitGeneralTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitGeneralTest.kt index bff49949ef..a204b27845 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitGeneralTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitGeneralTest.kt @@ -12,12 +12,12 @@ import com.intellij.ide.highlighter.HtmlFileType import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class MatchitGeneralTest : VimTestCase() { +class MatchitGeneralTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { @@ -173,7 +173,7 @@ class MatchitGeneralTest : VimTestCase() { originalVimAfter = """ if x == 0 puts "Zero" - $c + puts "Positive" end """, diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitHtmlTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitHtmlTest.kt index 09dff474c8..a6f4361722 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitHtmlTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitHtmlTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.extension.matchit import com.intellij.ide.highlighter.HtmlFileType import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class MatchitHtmlTest : VimTestCase() { +class MatchitHtmlTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitPhpTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitPhpTest.kt index 289cd10227..576e33d488 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitPhpTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitPhpTest.kt @@ -9,12 +9,12 @@ package org.jetbrains.plugins.ideavim.extension.matchit import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class MatchitPhpTest : VimTestCase() { +class MatchitPhpTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitRubyTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitRubyTest.kt index 1af7dc5ca9..9e16d20e58 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitRubyTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/matchit/MatchitRubyTest.kt @@ -8,12 +8,12 @@ package org.jetbrains.plugins.ideavim.extension.matchit -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class MatchitRubyTest : VimTestCase() { +class MatchitRubyTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/multiplecursors/VimMultipleCursorsExtensionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/multiplecursors/VimMultipleCursorsExtensionTest.kt index 773eac7486..19df964061 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/multiplecursors/VimMultipleCursorsExtensionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/multiplecursors/VimMultipleCursorsExtensionTest.kt @@ -9,18 +9,17 @@ package org.jetbrains.plugins.ideavim.extension.multiplecursors import com.maddyhome.idea.vim.api.injector -import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class VimMultipleCursorsExtensionTest : VimTestCase() { +class VimMultipleCursorsExtensionTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { @@ -189,7 +188,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() { |dfkjsg """.trimMargin() val editor = configureByText(before) - editor.vim.mode = Mode.VISUAL(SelectionType.CHARACTER_WISE) + editor.mode = Mode.VISUAL(SelectionType.CHARACTER_WISE) typeText(injector.parser.parseKeys("")) @@ -272,7 +271,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() { |dfkjsg """.trimMargin() val editor = configureByText(before) - editor.vim.mode = Mode.VISUAL(SelectionType.CHARACTER_WISE) + editor.mode = Mode.VISUAL(SelectionType.CHARACTER_WISE) typeText(injector.parser.parseKeys("")) assertMode(Mode.VISUAL(SelectionType.CHARACTER_WISE)) @@ -362,7 +361,7 @@ fun getCellType(${s}pos$se: VisualPosition): CellType { fun `test ignores regex in search pattern`() { val before = "test ${s}t.*st${c}$se toast tallest t.*st" val editor = configureByText(before) - editor.vim.mode = Mode.VISUAL(SelectionType.CHARACTER_WISE) + editor.mode = Mode.VISUAL(SelectionType.CHARACTER_WISE) typeText(injector.parser.parseKeys("")) val after = "test ${s}t.*st$se toast tallest ${s}t.*st$se" diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/paragraphmotion/ParagraphMotionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/paragraphmotion/ParagraphMotionTest.kt index 39a66dd75f..c6b891ac3d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/paragraphmotion/ParagraphMotionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/paragraphmotion/ParagraphMotionTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.extension.paragraphmotion import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class ParagraphMotionTest : VimTestCase() { +class ParagraphMotionTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/replacewithregister/ReplaceWithRegisterTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/replacewithregister/ReplaceWithRegisterTest.kt index ab0dc3f1df..10dcb8a7f1 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/replacewithregister/ReplaceWithRegisterTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/replacewithregister/ReplaceWithRegisterTest.kt @@ -16,7 +16,7 @@ import com.maddyhome.idea.vim.register.RegisterConstants.UNNAMED_REGISTER import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.annotations.TestWithPrimaryClipboard import org.jetbrains.plugins.ideavim.rangeOf import org.junit.jupiter.api.BeforeEach @@ -25,7 +25,7 @@ import org.junit.jupiter.api.TestInfo import kotlin.test.assertEquals import kotlin.test.assertTrue -class ReplaceWithRegisterTest : VimTestCase() { +class ReplaceWithRegisterTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { @@ -176,7 +176,7 @@ class ReplaceWithRegisterTest : VimTestCase() { assertEquals("one", VimPlugin.getRegister().lastRegister?.text) } - @VimBehaviorDiffers("one on${c}e on${c}e four") + @VimBehaviorDiffers("one one one four") @Test fun `test replace with multiple carets`() { val text = "one ${c}two ${c}three four" @@ -373,9 +373,9 @@ class ReplaceWithRegisterTest : VimTestCase() { @VimBehaviorDiffers( """ Lorem ipsum dolor sit amet, - ${c}Lorem ipsum dolor sit amet, + Lorem ipsum dolor sit amet, Sed in orci mauris. - ${c}Sed in orci mauris. + Sed in orci mauris. """, ) @Test diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/sneak/IdeaVimSneakTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/sneak/IdeaVimSneakTest.kt index 9759d64a70..d62f4569a5 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/sneak/IdeaVimSneakTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/sneak/IdeaVimSneakTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.extension.sneak import com.maddyhome.idea.vim.api.keys import com.maddyhome.idea.vim.state.mode.Mode -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo -class IdeaVimSneakTest : VimTestCase() { +class IdeaVimSneakTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/surround/VimSurroundExtensionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/surround/VimSurroundExtensionTest.kt index fce5bd13d5..96c2c953cc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/surround/VimSurroundExtensionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/surround/VimSurroundExtensionTest.kt @@ -13,7 +13,7 @@ package org.jetbrains.plugins.ideavim.extension.surround import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -21,7 +21,7 @@ import org.junit.jupiter.api.TestInfo /** * @author dhleong */ -class VimSurroundExtensionTest : VimTestCase() { +class VimSurroundExtensionTest : VimTestCaseBase() { @Throws(Exception::class) @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/extension/textobjindent/VimIndentObjectTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/extension/textobjindent/VimIndentObjectTest.kt index 761601fb0c..e1b18a2f2d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/extension/textobjindent/VimIndentObjectTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/extension/textobjindent/VimIndentObjectTest.kt @@ -12,7 +12,7 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -21,7 +21,7 @@ import org.junit.jupiter.api.TestInfo * @author Shrikant Sharat Kandula (@sharat87) */ @TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN) -class VimIndentObjectTest : VimTestCase() { +class VimIndentObjectTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/group/KeyGroupTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/group/KeyGroupTest.kt index cde9470bc5..dcb4fc8066 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/group/KeyGroupTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/group/KeyGroupTest.kt @@ -14,10 +14,10 @@ import com.maddyhome.idea.vim.command.MappingMode import com.maddyhome.idea.vim.key.MappingOwner import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class KeyGroupTest : VimTestCase() { +class KeyGroupTest : VimTestCaseBase() { private val owner = MappingOwner.Plugin.get("KeyGroupTest") @TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/group/SearchGroupTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/group/SearchGroupTest.kt index b6cea064e7..f6389c8296 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/group/SearchGroupTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/group/SearchGroupTest.kt @@ -23,7 +23,7 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test import kotlin.test.assertEquals @@ -32,7 +32,7 @@ import kotlin.test.assertEquals * @author Alex Plate */ @Suppress("SpellCheckingInspection") -class SearchGroupTest : VimTestCase() { +class SearchGroupTest : VimTestCaseBase() { @Test fun `test one letter`() { configureByText( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_ScrollCaretIntoViewHorizontally_Test.kt b/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_ScrollCaretIntoViewHorizontally_Test.kt index 80096d9c6e..3a43621766 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_ScrollCaretIntoViewHorizontally_Test.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_ScrollCaretIntoViewHorizontally_Test.kt @@ -11,12 +11,12 @@ package org.jetbrains.plugins.ideavim.group.motion 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.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.math.roundToInt @Suppress("ClassName") -class MotionGroup_ScrollCaretIntoViewHorizontally_Test : VimTestCase() { +class MotionGroup_ScrollCaretIntoViewHorizontally_Test : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.SCROLL) @Test fun `test moving right scrolls half screen to right by default`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_ScrollCaretIntoViewVertically_Test.kt b/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_ScrollCaretIntoViewVertically_Test.kt index b65b35d3ff..f896839059 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_ScrollCaretIntoViewVertically_Test.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_ScrollCaretIntoViewVertically_Test.kt @@ -11,11 +11,11 @@ package org.jetbrains.plugins.ideavim.group.motion 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.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test @Suppress("ClassName") -class MotionGroup_ScrollCaretIntoViewVertically_Test : VimTestCase() { +class MotionGroup_ScrollCaretIntoViewVertically_Test : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.SCROLL) @Test fun `test moving up causes scrolling up`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_scrolloff_scrolljump_Test.kt b/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_scrolloff_scrolljump_Test.kt index 277d0a09da..778459282a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_scrolloff_scrolljump_Test.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/group/motion/MotionGroup_scrolloff_scrolljump_Test.kt @@ -14,7 +14,7 @@ import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @@ -22,7 +22,7 @@ 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(TestOptionConstants.scrolloff) -class MotionGroup_scrolloff_Test : VimTestCase() { +class MotionGroup_scrolloff_Test : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest(VimOption(TestOptionConstants.scrolloff, limitedValues = ["0"])) fun `test move up shows no context with scrolloff=0`() { @@ -352,7 +352,7 @@ class MotionGroup_scrolloff_Test : VimTestCase() { } @TraceOptions(TestOptionConstants.scrolljump) -class MotionGroup_scrolljump_Test : VimTestCase() { +class MotionGroup_scrolljump_Test : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest(VimOption(TestOptionConstants.scrolljump, limitedValues = ["0"])) fun `test move up scrolls single line with scrolljump=0`() { @@ -435,7 +435,7 @@ class MotionGroup_scrolljump_Test : VimTestCase() { } @TraceOptions(TestOptionConstants.scrolljump, TestOptionConstants.scrolloff) -class MotionGroup_scrolloff_scrolljump_Test : VimTestCase() { +class MotionGroup_scrolloff_scrolljump_Test : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.OPTION) @OptionTest( VimOption(TestOptionConstants.scrolljump, limitedValues = ["10"]), diff --git a/src/test/java/org/jetbrains/plugins/ideavim/group/visual/IdeaVisualControlTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/group/visual/IdeaVisualControlTest.kt index ba784b283a..81ca8e477d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/group/visual/IdeaVisualControlTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/group/visual/IdeaVisualControlTest.kt @@ -26,7 +26,7 @@ import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestOptionConstants import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.impl.OptionTest import org.jetbrains.plugins.ideavim.impl.TraceOptions import org.jetbrains.plugins.ideavim.impl.VimOption @@ -35,7 +35,7 @@ import org.jetbrains.plugins.ideavim.waitAndAssertMode import kotlin.test.assertNull @TraceOptions(TestOptionConstants.selectmode) -class IdeaVisualControlTest : VimTestCase() { +class IdeaVisualControlTest : VimTestCaseBase() { @OptionTest(VimOption(TestOptionConstants.selectmode, doesntAffectTest = true)) @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) fun `test enable character selection no selection`() { @@ -93,7 +93,7 @@ class IdeaVisualControlTest : VimTestCase() { originalVimAfter = """ Lorem Ipsum - I ${s}found i${c}t$se in a legendary land + I ${s}found it$se in a legendary land consectetur adipiscing elit Sed in orci mauris. Cras id tellus in ex imperdiet egestas. diff --git a/src/test/java/org/jetbrains/plugins/ideavim/group/visual/NonVimVisualChangeTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/group/visual/NonVimVisualChangeTest.kt index f5f78ae4e0..95b9b7eb0d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/group/visual/NonVimVisualChangeTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/group/visual/NonVimVisualChangeTest.kt @@ -18,7 +18,7 @@ import com.maddyhome.idea.vim.state.mode.SelectionType import com.maddyhome.idea.vim.state.mode.selectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.assertDoesntChange import org.jetbrains.plugins.ideavim.rangeOf import org.jetbrains.plugins.ideavim.waitAndAssert @@ -29,7 +29,7 @@ import kotlin.test.assertEquals /** * @author Alex Plate */ -class NonVimVisualChangeTest : VimTestCase() { +class NonVimVisualChangeTest : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) @Test fun `test save mode after removing text`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/helper/CaretVisualAttributesHelperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/helper/CaretVisualAttributesHelperTest.kt index 251ada71dd..6a72f48939 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/helper/CaretVisualAttributesHelperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/helper/CaretVisualAttributesHelperTest.kt @@ -19,10 +19,10 @@ import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class CaretVisualAttributesHelperTest : VimTestCase() { +class CaretVisualAttributesHelperTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.NOT_VIM_TESTING) @Test fun `test default normal mode caret is block`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/helper/EditorHelperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/helper/EditorHelperTest.kt index 925e998018..6ca0bd8703 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/helper/EditorHelperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/helper/EditorHelperTest.kt @@ -11,12 +11,12 @@ package org.jetbrains.plugins.ideavim.helper 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.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.math.roundToInt import kotlin.test.assertEquals -class EditorHelperTest : VimTestCase() { +class EditorHelperTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.NOT_VIM_TESTING) @Test fun `test scroll column to left of screen`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/helper/SearchHelperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/helper/SearchHelperTest.kt index 41ddc0b7e6..875393dd86 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/helper/SearchHelperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/helper/SearchHelperTest.kt @@ -15,14 +15,14 @@ import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.MethodSource import java.util.stream.Stream @Suppress("SpellCheckingInspection") -class SearchHelperTest : VimTestCase() { +class SearchHelperTest : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) @Test fun testFindNextWord() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/helper/StringHelperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/helper/StringHelperTest.kt index ffe7be64d0..5b74997e6d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/helper/StringHelperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/helper/StringHelperTest.kt @@ -8,13 +8,13 @@ package org.jetbrains.plugins.ideavim.helper import com.maddyhome.idea.vim.api.injector -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import java.awt.event.InputEvent import javax.swing.KeyStroke import kotlin.test.assertEquals -class StringHelperTest : VimTestCase() { +class StringHelperTest : VimTestCaseBase() { @Test fun testFalseSpecialKey() { val expectedKeys = injector.parser.parseKeys("move '<-2").toMutableList() diff --git a/src/test/java/org/jetbrains/plugins/ideavim/key/MappingOwnerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/key/MappingOwnerTest.kt index ad3e3eb188..9cd29966eb 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/key/MappingOwnerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/key/MappingOwnerTest.kt @@ -9,11 +9,11 @@ package org.jetbrains.plugins.ideavim.key import com.maddyhome.idea.vim.key.MappingOwner -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertSame -class MappingOwnerTest : VimTestCase() { +class MappingOwnerTest : VimTestCaseBase() { @Test fun `test get two plugin owners`() { val pluginName = "MyPlugin" diff --git a/src/test/java/org/jetbrains/plugins/ideavim/listener/VimListenersTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/listener/VimListenersTest.kt index d184d69eda..03520dccdc 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/listener/VimListenersTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/listener/VimListenersTest.kt @@ -10,12 +10,12 @@ package org.jetbrains.plugins.ideavim.listener import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.listener.VimListenerTestObject -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Test import kotlin.test.assertEquals -class VimListenersTest : VimTestCase() { +class VimListenersTest : VimTestCaseBase() { @AfterEach fun tearDown() { VimListenerTestObject.disposedCounter = 0 diff --git a/src/test/java/org/jetbrains/plugins/ideavim/mock/MockTestCase.kt b/src/test/java/org/jetbrains/plugins/ideavim/mock/MockTestCase.kt index 9340f73184..023361c038 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/mock/MockTestCase.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/mock/MockTestCase.kt @@ -18,12 +18,12 @@ import com.intellij.testFramework.replaceService import com.maddyhome.idea.vim.api.ExecutionContext import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.newapi.vim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.mockito.Mockito import javax.swing.JTextArea -open class MockTestCase : VimTestCase() { +open class MockTestCase : VimTestCaseBase() { @TestDisposable lateinit var disposable: Disposable diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/BoundedStringListOptionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/BoundedStringListOptionTest.kt index 8dac22c570..a7cb7eda69 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/BoundedStringListOptionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/BoundedStringListOptionTest.kt @@ -15,14 +15,14 @@ import com.maddyhome.idea.vim.options.OptionDeclaredScope import com.maddyhome.idea.vim.options.StringListOption import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo import kotlin.test.assertEquals -class BoundedStringListOptionTest : VimTestCase() { +class BoundedStringListOptionTest : VimTestCaseBase() { private val optionName = "myOpt" private val defaultValue = "Monday,Tuesday" private val option = StringListOption( diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/DigraphTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/DigraphTest.kt index 0e86c5efda..59672fd483 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/DigraphTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/DigraphTest.kt @@ -11,14 +11,14 @@ package org.jetbrains.plugins.ideavim.option import com.maddyhome.idea.vim.state.mode.Mode import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test /** * @author Alex Plate */ // TODO: 2019-06-18 VimOptionsTestCase -class DigraphTest : VimTestCase() { +class DigraphTest : VimTestCaseBase() { @TestWithoutNeovim(SkipNeovimReason.UNCLEAR, "backspace works strange") @Test fun `test digraph`() { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/EffectiveOptionChangeListenerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/EffectiveOptionChangeListenerTest.kt index f950871041..908de3080a 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/EffectiveOptionChangeListenerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/EffectiveOptionChangeListenerTest.kt @@ -29,7 +29,7 @@ import com.maddyhome.idea.vim.vimscript.model.datatypes.VimInt import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -41,7 +41,7 @@ private const val defaultValue = "defaultValue" private const val defaultNumberValue = 10 @TestWithoutNeovim(reason = SkipNeovimReason.OPTION) -class EffectiveOptionChangeListenerTest : VimTestCase() { +class EffectiveOptionChangeListenerTest : VimTestCaseBase() { private val optionName = "test" private lateinit var manager: FileEditorManagerImpl private lateinit var otherBufferWindow: Editor @@ -70,7 +70,7 @@ class EffectiveOptionChangeListenerTest : VimTestCase() { // Create the original editor last, so that fixture.editor will point to this file // It is STRONGLY RECOMMENDED to use originalEditor instead of fixture.editor, so we know which editor we're using - originalEditor = configureByText("\n") // aaa.txt + originalEditor = configureByText("\n").ij // aaa.txt // Split the current window. Since no options have been set, it will have default values splitWindow = openSplitWindow(originalEditor) // aaa.txt diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/GlobalOptionChangeListenerTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/GlobalOptionChangeListenerTest.kt index 0d1dc2bc8c..d6f6001bf3 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/GlobalOptionChangeListenerTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/GlobalOptionChangeListenerTest.kt @@ -17,7 +17,7 @@ import com.maddyhome.idea.vim.options.StringOption import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -27,7 +27,7 @@ import kotlin.test.assertFalse import kotlin.test.assertTrue @TestWithoutNeovim(reason = SkipNeovimReason.OPTION) -class GlobalOptionChangeListenerTest: VimTestCase() { +class GlobalOptionChangeListenerTest: VimTestCaseBase() { private val optionName = "test" private val defaultValue = "defaultValue" diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/GuiCursorOptionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/GuiCursorOptionTest.kt index 9ed6c2591d..82b690f179 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/GuiCursorOptionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/GuiCursorOptionTest.kt @@ -13,13 +13,13 @@ import com.maddyhome.idea.vim.helper.enumSetOf import com.maddyhome.idea.vim.options.helpers.GuiCursorMode import com.maddyhome.idea.vim.options.helpers.GuiCursorOptionHelper import com.maddyhome.idea.vim.options.helpers.GuiCursorType -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo import kotlin.test.assertEquals -class GuiCursorOptionTest : VimTestCase() { +class GuiCursorOptionTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/KeywordOptionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/KeywordOptionTest.kt index c509e72cdd..1a9b17f07d 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/KeywordOptionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/KeywordOptionTest.kt @@ -11,7 +11,7 @@ import com.maddyhome.idea.vim.helper.CharacterHelper import com.maddyhome.idea.vim.helper.CharacterHelper.charType import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.options.helpers.KeywordOptionHelper -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -19,7 +19,7 @@ import kotlin.test.assertEquals import kotlin.test.assertSame import kotlin.test.assertTrue -class KeywordOptionTest : VimTestCase() { +class KeywordOptionTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/OptionAccessScopeTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/OptionAccessScopeTest.kt index 8c0d62ceb2..24e56f7167 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/OptionAccessScopeTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/OptionAccessScopeTest.kt @@ -19,7 +19,7 @@ import com.maddyhome.idea.vim.vimscript.model.datatypes.VimInt import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -29,7 +29,7 @@ import kotlin.test.assertEquals private const val OPTION_NAME = "test" @TestWithoutNeovim(reason = SkipNeovimReason.OPTION) -class OptionAccessScopeTest: VimTestCase() { +class OptionAccessScopeTest: VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/OptionDeclaredScopeTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/OptionDeclaredScopeTest.kt index 2ff1b527b6..7797f59246 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/OptionDeclaredScopeTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/OptionDeclaredScopeTest.kt @@ -18,6 +18,7 @@ import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory import com.intellij.testFramework.replaceService import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.api.injector +import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.options.Option import com.maddyhome.idea.vim.options.OptionAccessScope @@ -26,7 +27,7 @@ import com.maddyhome.idea.vim.options.StringOption import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Disabled @@ -37,7 +38,7 @@ import kotlin.test.assertEquals // Tests the implementation of global, local to buffer, local to window and global-local @TestWithoutNeovim(reason = SkipNeovimReason.OPTION) -class OptionDeclaredScopeTest : VimTestCase() { +class OptionDeclaredScopeTest : VimTestCaseBase() { private val optionName = "test" private val defaultValue = VimString("defaultValue") private val setValue = VimString("setValue") @@ -60,7 +61,7 @@ class OptionDeclaredScopeTest : VimTestCase() { // Create the original editor last, so that fixture.editor will point to this file // It is STRONGLY RECOMMENDED to use originalEditor instead of fixture.editor, so we know which editor we're using - originalEditor = configureByText("\n") // aaa.txt + originalEditor = configureByText("\n").ij // aaa.txt manager.currentWindow.let { // Split the original editor into a new window, then reset the focus back to the originalEditor's EditorWindow diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/StringListOptionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/StringListOptionTest.kt index cbc1cd9dfa..caab7368a9 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/StringListOptionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/StringListOptionTest.kt @@ -13,7 +13,7 @@ import com.maddyhome.idea.vim.api.options import com.maddyhome.idea.vim.newapi.vim import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -21,7 +21,7 @@ import org.junit.jupiter.api.TestInfo import kotlin.test.assertEquals @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class StringListOptionTest : VimTestCase() { +class StringListOptionTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/StringOptionTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/StringOptionTest.kt index 48217ae771..96767b23a4 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/StringOptionTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/StringOptionTest.kt @@ -13,7 +13,7 @@ import com.maddyhome.idea.vim.api.options import com.maddyhome.idea.vim.newapi.vim import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -21,7 +21,7 @@ import org.junit.jupiter.api.TestInfo import kotlin.test.assertEquals @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class StringOptionTest : VimTestCase() { +class StringOptionTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/BreakIndentOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/BreakIndentOptionMapperTest.kt index 54b8a89459..2a97663eb5 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/BreakIndentOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/BreakIndentOptionMapperTest.kt @@ -15,7 +15,7 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.group.IjOptions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.BeforeEach @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class BreakIndentOptionMapperTest : VimTestCase() { +class BreakIndentOptionMapperTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ColorColumnOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ColorColumnOptionMapperTest.kt index 053c1b784a..758460463e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ColorColumnOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ColorColumnOptionMapperTest.kt @@ -18,7 +18,7 @@ import com.intellij.testFramework.fixtures.CodeInsightTestFixture import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class ColorColumnOptionMapperTest : VimTestCase() { +class ColorColumnOptionMapperTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/CursorLineOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/CursorLineOptionMapperTest.kt index 0c8fa5309c..09ffc610a5 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/CursorLineOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/CursorLineOptionMapperTest.kt @@ -13,7 +13,7 @@ import com.intellij.openapi.editor.impl.SettingsImpl import com.maddyhome.idea.vim.group.IjOptions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.BeforeEach @@ -22,7 +22,7 @@ import org.junit.jupiter.api.TestInfo import kotlin.test.assertEquals @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class CursorLineOptionMapperTest : VimTestCase() { +class CursorLineOptionMapperTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/LineNumberOptionsMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/LineNumberOptionsMapperTest.kt index 8e46d20e19..5f23c190e0 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/LineNumberOptionsMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/LineNumberOptionsMapperTest.kt @@ -14,10 +14,9 @@ import com.intellij.testFramework.fixtures.CodeInsightTestFixture import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory import com.maddyhome.idea.vim.api.Options import com.maddyhome.idea.vim.api.injector -import com.maddyhome.idea.vim.group.IjOptions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue @@ -26,7 +25,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class LineNumberOptionsMapperTest : VimTestCase() { +class LineNumberOptionsMapperTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ListOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ListOptionMapperTest.kt index fa03bc2dec..057bf60e14 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ListOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ListOptionMapperTest.kt @@ -13,7 +13,7 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.group.IjOptions import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.BeforeEach @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class ListOptionMapperTest : VimTestCase() { +class ListOptionMapperTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ScrollJumpOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ScrollJumpOptionMapperTest.kt index fbdd0c70a1..4bed9cb44e 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ScrollJumpOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ScrollJumpOptionMapperTest.kt @@ -15,7 +15,7 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.newapi.ij import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertNotEquals import org.junit.jupiter.api.Assertions.assertTrue @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class ScrollJumpOptionMapperTest : VimTestCase() { +class ScrollJumpOptionMapperTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ScrollOffOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ScrollOffOptionMapperTest.kt index 59d92b84ef..9ed5eeb760 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ScrollOffOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/ScrollOffOptionMapperTest.kt @@ -16,14 +16,14 @@ import com.maddyhome.idea.vim.api.options import com.maddyhome.idea.vim.newapi.vim import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class ScrollOffOptionMapperTest : VimTestCase() { +class ScrollOffOptionMapperTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/SideScrollOffOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/SideScrollOffOptionMapperTest.kt index 0449c31e4e..176b3e2dde 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/SideScrollOffOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/SideScrollOffOptionMapperTest.kt @@ -16,14 +16,14 @@ import com.maddyhome.idea.vim.api.options import com.maddyhome.idea.vim.newapi.vim import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class SideScrollOffOptionMapperTest : VimTestCase() { +class SideScrollOffOptionMapperTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/SideScrollOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/SideScrollOptionMapperTest.kt index e78c1faced..4c7f38fb79 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/SideScrollOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/SideScrollOptionMapperTest.kt @@ -15,7 +15,7 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.newapi.ij import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertNotEquals import org.junit.jupiter.api.Assertions.assertTrue @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class SideScrollOptionMapperTest : VimTestCase() { +class SideScrollOptionMapperTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/TextWidthOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/TextWidthOptionMapperTest.kt index 21968a4ff5..747183b736 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/TextWidthOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/TextWidthOptionMapperTest.kt @@ -24,7 +24,7 @@ import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory import com.intellij.testFramework.replaceService import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.BeforeEach @@ -34,7 +34,7 @@ import javax.swing.SwingConstants import kotlin.test.assertEquals @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class TextWidthOptionMapperTest : VimTestCase() { +class TextWidthOptionMapperTest : VimTestCaseBase() { // IntelliJ can have a margin set, but not act on it. We want to maintain this, not least because the right margin // visual guide is shown by default diff --git a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/WrapOptionMapperTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/WrapOptionMapperTest.kt index b773a438ea..f71f6fc25c 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/WrapOptionMapperTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/option/overrides/WrapOptionMapperTest.kt @@ -18,7 +18,7 @@ import com.intellij.testFramework.replaceService import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo @@ -26,7 +26,7 @@ import kotlin.test.assertFalse import kotlin.test.assertTrue @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) -class WrapOptionMapperTest : VimTestCase() { +class WrapOptionMapperTest : VimTestCaseBase() { private lateinit var manager: FileEditorManagerImpl @BeforeEach diff --git a/src/test/java/org/jetbrains/plugins/ideavim/regex/VimRegexEngineTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/regex/VimRegexEngineTest.kt index 99840bae4e..0f9259944c 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/regex/VimRegexEngineTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/regex/VimRegexEngineTest.kt @@ -14,11 +14,11 @@ import com.maddyhome.idea.vim.common.TextRange import com.maddyhome.idea.vim.mark.VimMark import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.regexp.VimRegex -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.test.assertEquals -class VimRegexEngineTest : VimTestCase() { +class VimRegexEngineTest : VimTestCaseBase() { private fun findAll(pattern: String): List { val regex = VimRegex(pattern) return regex.findAll(fixture.editor.vim).map { it.range } diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ui/ReloadVimRcTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ui/ReloadVimRcTest.kt index 9414dee80a..d8356a7907 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ui/ReloadVimRcTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ui/ReloadVimRcTest.kt @@ -14,14 +14,14 @@ import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.ui.VimRcFileState import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInfo import java.nio.file.Files -class ReloadVimRcTest : VimTestCase() { +class ReloadVimRcTest : VimTestCaseBase() { private val editorFactory = MockEditorFactory() @BeforeEach diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ui/ShowCmdTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ui/ShowCmdTest.kt index 05fe45373b..6059597ffe 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ui/ShowCmdTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ui/ShowCmdTest.kt @@ -13,7 +13,7 @@ import com.maddyhome.idea.vim.ui.ShowCmd import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim import org.jetbrains.plugins.ideavim.VimBehaviorDiffers -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.waitAndAssert import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Disabled @@ -22,7 +22,7 @@ import org.junit.jupiter.api.TestInfo import kotlin.test.assertEquals import kotlin.test.assertTrue -class ShowCmdTest : VimTestCase() { +class ShowCmdTest : VimTestCaseBase() { @BeforeEach override fun setUp(testInfo: TestInfo) { super.setUp(testInfo) diff --git a/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/NeovimTesting.kt b/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/NeovimTesting.kt index 1f160114f1..9d54f64666 100644 --- a/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/NeovimTesting.kt +++ b/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/NeovimTesting.kt @@ -71,7 +71,7 @@ object NeovimTesting { fun tearDown(test: TestInfo) { if (!neovimEnabled(test)) return println("Tested with neovim: $neovimTestsCounter") - if (VimTestCase.Checks.neoVim.exitOnTearDown) { + if (VimTestCaseBase.Checks.neoVim.exitOnTearDown) { neovimApi.input(exitCommand).get() } neovim.destroy() @@ -184,7 +184,7 @@ object NeovimTesting { private fun assertRegisters() { for (register in VALID_REGISTERS) { if (register in nonCheckingRegisters) continue - if (register in VimTestCase.Checks.neoVim.ignoredRegisters) continue + if (register in VimTestCaseBase.Checks.neoVim.ignoredRegisters) continue val neovimRegister = getRegister(register) val vimPluginRegister = VimPlugin.getRegister().getRegister(register) val ideavimRegister = vimPluginRegister?.text ?: "" diff --git a/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCase.kt b/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCaseBase.kt similarity index 82% rename from src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCase.kt rename to src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCaseBase.kt index 186c7ff161..ba6ebe7db7 100644 --- a/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCase.kt +++ b/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCaseBase.kt @@ -51,6 +51,7 @@ import com.maddyhome.idea.vim.action.VimShortcutKeyAction import com.maddyhome.idea.vim.api.EffectiveOptions import com.maddyhome.idea.vim.api.GlobalOptions import com.maddyhome.idea.vim.api.Options +import com.maddyhome.idea.vim.api.VimEditor import com.maddyhome.idea.vim.api.VimOptionGroup import com.maddyhome.idea.vim.api.globalOptions import com.maddyhome.idea.vim.api.injector @@ -58,7 +59,6 @@ import com.maddyhome.idea.vim.api.options import com.maddyhome.idea.vim.api.setToggleOption import com.maddyhome.idea.vim.api.visualLineToBufferLine import com.maddyhome.idea.vim.command.MappingMode -import com.maddyhome.idea.vim.ex.ExException import com.maddyhome.idea.vim.ex.ExOutputModel import com.maddyhome.idea.vim.group.EffectiveIjOptions import com.maddyhome.idea.vim.group.GlobalIjOptions @@ -72,8 +72,10 @@ import com.maddyhome.idea.vim.helper.getGuiCursorMode import com.maddyhome.idea.vim.key.MappingOwner import com.maddyhome.idea.vim.key.ToKeysMappingInfo import com.maddyhome.idea.vim.listener.SelectionVimListenerSuppressor +import com.maddyhome.idea.vim.model.VimTestCase import com.maddyhome.idea.vim.newapi.IjVimEditor import com.maddyhome.idea.vim.newapi.globalIjOptions +import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.newapi.ijOptions import com.maddyhome.idea.vim.newapi.vim import com.maddyhome.idea.vim.options.OptionAccessScope @@ -90,12 +92,10 @@ import org.jetbrains.annotations.ApiStatus import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.TestInfo -import org.junit.jupiter.api.assertThrows import java.awt.event.KeyEvent import java.util.* import javax.swing.KeyStroke import kotlin.math.roundToInt -import kotlin.test.assertContains import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertNull @@ -110,8 +110,11 @@ import kotlin.test.assertTrue */ @RunInEdt(writeIntent = true) @ApiStatus.Internal -abstract class VimTestCase { +abstract class VimTestCaseBase : VimTestCase { protected lateinit var fixture: CodeInsightTestFixture + override val editor: VimEditor + get() = fixture.editor.vim + override val c: String = VimTestCaseBase.c lateinit var testInfo: TestInfo @@ -237,20 +240,6 @@ abstract class VimTestCase { } } - protected fun assertEmpty(collection: Collection) { - assertTrue(collection.isEmpty(), "Collection should be empty, but it contains ${collection.size} elements") - } - - protected fun typeTextInFile(keys: List, fileContents: String): Editor { - configureByText(fileContents) - return typeText(keys) - } - - protected fun typeTextInFile(keys: String, fileContents: String): Editor { - configureByText(fileContents) - return typeText(keys) - } - protected val screenWidth: Int get() = 80 protected val screenHeight: Int @@ -268,11 +257,6 @@ abstract class VimTestCase { (fixture.editor as EditorEx).scrollPane.viewport.doLayout() } - protected fun configureByText(content: String) = configureByText(PlainTextFileType.INSTANCE, content) - protected fun configureByXmlText(content: String) = configureByText(XmlFileType.INSTANCE, content) - protected fun configureByJsonText(@Suppress("SameParameterValue") content: String) = - configureByText(JsonFileType.INSTANCE, content) - protected fun configureAndGuard(content: String) { val ranges = extractBrackets(content) for ((start, end) in ranges) { @@ -306,12 +290,21 @@ abstract class VimTestCase { return ranges } - protected fun configureByText(fileType: FileType, content: String): Editor { + override fun configureByText(fileType: com.maddyhome.idea.vim.model.FileType, content: String): VimEditor { + val fType = when (fileType) { + com.maddyhome.idea.vim.model.FileType.PLAIN_TEXT -> PlainTextFileType.INSTANCE + com.maddyhome.idea.vim.model.FileType.XML -> XmlFileType.INSTANCE + com.maddyhome.idea.vim.model.FileType.JSON -> JsonFileType.INSTANCE + } + return configureByText(fType, content) + } + + fun configureByText(fileType: FileType, content: String): VimEditor { fixture.configureByText(fileType, content) setDefaultIntelliJSettings(fixture.editor) NeovimTesting.setupEditor(fixture.editor, testInfo) setEditorVisibleSize(screenWidth, screenHeight) - return fixture.editor + return editor } private fun configureByText(fileName: String, content: String): Editor { @@ -399,34 +392,20 @@ abstract class VimTestCase { assertTrue(caretLogicalLine >= scrollToLogicalLine) } - protected fun typeText(vararg keys: String) = typeText(keys.flatMap { injector.parser.parseKeys(it) }) - - protected fun typeText(keys: List): Editor { - return typeText(fixture.editor, keys) - } - - protected fun typeText(editor: Editor, keys: List): Editor { + override fun typeText(editor: VimEditor, keys: List): VimEditor { NeovimTesting.typeCommand( keys.filterNotNull().joinToString(separator = "") { injector.parser.toKeyNotation(it) }, testInfo, - editor, + editor.ij, ) val project = fixture.project when (Checks.keyHandler) { - Checks.KeyHandlerMethod.DIRECT_TO_VIM -> typeText(keys.filterNotNull(), editor, project) - Checks.KeyHandlerMethod.VIA_IDE -> typeTextViaIde(keys.filterNotNull(), editor) + Checks.KeyHandlerMethod.DIRECT_TO_VIM -> typeText(keys.filterNotNull(), editor.ij, project) + Checks.KeyHandlerMethod.VIA_IDE -> typeTextViaIde(keys.filterNotNull(), editor.ij) } return editor } - protected fun enterCommand(command: String): Editor { - return typeText(commandToKeys(command)) - } - - protected fun enterSearch(pattern: String, forwards: Boolean = true): Editor { - return typeText(searchToKeys(pattern, forwards)) - } - protected fun setText(text: String) { WriteAction.runAndWait { fixture.editor.document.setText(text) @@ -498,11 +477,16 @@ abstract class VimTestCase { return injector.globalIjOptions() } - fun assertState(textAfter: String) { + override fun assertState(textAfter: String) { fixture.checkResult(textAfter) NeovimTesting.assertState(fixture.editor, testInfo) } + override fun assertState(textAfter: String, modeAfter: Mode) { + assertState(textAfter) + assertState(modeAfter) + } + fun mode(): String? { return NeovimTesting.vimMode() } @@ -511,22 +495,7 @@ abstract class VimTestCase { return NeovimTesting.getMark(char) } - protected fun assertRegister(char: Char, expected: String?) { - val actual = injector.registerGroup.getRegister(char)?.keys?.let(injector.parser::toKeyNotation) - assertEquals(expected, actual, "Wrong register contents") - } - - protected fun assertRegisterString(char: Char, expected: String?) { - val actual = injector.registerGroup.getRegister(char)?.keys?.let(injector.parser::toPrintableString) - assertEquals(expected, actual, "Wrong register contents") - } - - protected fun assertState(modeAfter: Mode) { - assertMode(modeAfter) - assertCaretsVisualAttributes() - } - - fun assertPosition(line: Int, column: Int) { + override fun assertPosition(line: Int, column: Int) { val carets = fixture.editor.caretModel.allCarets assertEquals(1, carets.size, "Wrong amount of carets") val actualPosition = carets[0].logicalPosition @@ -534,14 +503,7 @@ abstract class VimTestCase { NeovimTesting.assertCaret(fixture.editor, testInfo) } - fun assertVisualPosition(visualLine: Int, visualColumn: Int) { - val carets = fixture.editor.caretModel.allCarets - assertEquals(1, carets.size, "Wrong amount of carets") - val actualPosition = carets[0].visualPosition - assertEquals(VisualPosition(visualLine, visualColumn), actualPosition) - } - - fun assertOffset(vararg expectedOffsets: Int) { + override fun assertOffset(vararg expectedOffsets: Int) { val carets = fixture.editor.caretModel.allCarets if (expectedOffsets.size == 2 && carets.size == 1) { assertEquals( @@ -558,32 +520,6 @@ abstract class VimTestCase { NeovimTesting.assertState(fixture.editor, testInfo) } - fun assertOffsetAt(text: String) { - val indexOf = fixture.editor.document.charsSequence.indexOf(text) - if (indexOf < 0) kotlin.test.fail() - assertOffset(indexOf) - } - - // Use logical rather than visual lines, so we can correctly test handling of collapsed folds and soft wraps - fun assertVisibleArea(topLogicalLine: Int, bottomLogicalLine: Int) { - assertTopLogicalLine(topLogicalLine) - assertBottomLogicalLine(bottomLogicalLine) - } - - fun assertTopLogicalLine(topLogicalLine: Int) { - val actualVisualTop = EditorHelper.getVisualLineAtTopOfScreen(fixture.editor) - val actualLogicalTop = fixture.editor.vim.visualLineToBufferLine(actualVisualTop) - - assertEquals(topLogicalLine, actualLogicalTop, "Top logical lines don't match") - } - - fun assertBottomLogicalLine(bottomLogicalLine: Int) { - val actualVisualBottom = EditorHelper.getVisualLineAtBottomOfScreen(fixture.editor) - val actualLogicalBottom = fixture.editor.vim.visualLineToBufferLine(actualVisualBottom) - - assertEquals(bottomLogicalLine, actualLogicalBottom, "Bottom logical lines don't match") - } - fun assertVisibleLineBounds(logicalLine: Int, leftLogicalColumn: Int, rightLogicalColumn: Int) { val visualLine = IjVimEditor(fixture.editor).bufferLineToVisualLine(logicalLine) val actualLeftVisualColumn = EditorHelper.getVisualColumnAtLeftOfDisplay(fixture.editor, visualLine) @@ -644,56 +580,29 @@ abstract class VimTestCase { } } - fun assertMode(expectedMode: Mode) { - val mode = fixture.editor.vim.mode - assertEquals(expectedMode, mode) - } - fun assertSelection(expected: String?) { val selected = fixture.editor.selectionModel.selectedText assertEquals(expected, selected) } - fun assertCommandOutput(command: String, expected: String) { - enterCommand(command) - assertExOutput(expected) - } - - fun assertExOutput(expected: String, clear: Boolean = true) { + override fun assertExOutput(expected: String) { val actual = injector.outputPanel.getCurrentOutputPanel()?.text assertNotNull(actual, "No Ex output") assertEquals(expected, actual) NeovimTesting.typeCommand("", testInfo, fixture.editor) - if (clear) { - // Ex output is not cleared until the output pane is activated again (we need it to persist so that :print will - // work when called multiple times from :global). When testing, if the previous action fails before it can - // activate the output pane, we'll be looking at stale results. - ExOutputModel.getInstance(fixture.editor).clear() - } + + // Ex output is not cleared until the output pane is activated again (we need it to persist so that :print will + // work when called multiple times from :global). When testing, if the previous action fails before it can + // activate the output pane, we'll be looking at stale results. + ExOutputModel.getInstance(fixture.editor).clear() } - fun assertNoExOutput() { + override fun assertNoExOutput() { val actual = ExOutputModel.getInstance(fixture.editor).text assertEquals("", actual) } - fun assertPluginError(isError: Boolean) { - assertEquals(isError, injector.messages.isError()) - } - - fun assertPluginErrorMessageContains(message: String) { - assertContains(VimPlugin.getMessage(), message) - } - - fun assertStatusLineMessageContains(message: String) { - assertContains(VimPlugin.getMessage(), message) - } - - fun assertStatusLineCleared() { - assertNull(VimPlugin.getMessage()) - } - - protected fun assertCaretsVisualAttributes() { + override fun assertCaretsVisualAttributes() { if (!Checks.caretShape) return val editor = fixture.editor val attributes = GuiCursorOptionHelper.getAttributes(getGuiCursorMode(editor)) @@ -764,14 +673,14 @@ abstract class VimTestCase { performTest(keys, after, modeAfter) } - protected fun performTest(keys: String, after: String, modeAfter: Mode) { + override fun performTest(keys: String, after: String, modeAfter: Mode) { typeText(keys) PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue() assertState(after) assertState(modeAfter) } - protected fun setRegister(register: Char, keys: String) { + override fun setRegister(register: Char, keys: String) { VimPlugin.getRegister().setKeys(register, injector.parser.stringToKeys(keys)) NeovimTesting.setRegister(register, keys, testInfo) } @@ -811,13 +720,6 @@ abstract class VimTestCase { Checks.setup() } - protected fun assertExException(expectedErrorMessage: String, action: () -> Unit) { - val exception = assertThrows { - action() - } - assertEquals(expectedErrorMessage, exception.message) - } - private fun typeTextViaIde(keys: List, editor: Editor) { TestInputModel.getInstance(editor).setKeyStrokes(keys.filterNotNull()) @@ -907,33 +809,6 @@ abstract class VimTestCase { null, ) } - - @JvmStatic - fun commandToKeys(command: String): List { - val keys: MutableList = ArrayList() - if (!command.startsWith(":")) { - keys.addAll(injector.parser.parseKeys(":")) - } - keys.addAll(injector.parser.stringToKeys(command)) // Avoids trying to parse 'command ... ' as a special char - keys.addAll(injector.parser.parseKeys("")) - return keys - } - - fun exCommand(command: String) = ":$command" - - fun searchToKeys(pattern: String, forwards: Boolean): List { - val keys: MutableList = ArrayList() - keys.addAll(injector.parser.parseKeys(if (forwards) "/" else "?")) - keys.addAll(injector.parser.stringToKeys(pattern)) // Avoids trying to parse 'command ... ' as a special char - keys.addAll(injector.parser.parseKeys("")) - return keys - } - - fun searchCommand(pattern: String) = "$pattern" - - fun String.dotToTab(): String = replace('.', '\t') - - fun String.dotToSpace(): String = replace('.', ' ') } object Checks { diff --git a/tests/java-tests/build.gradle.kts b/tests/java-tests/build.gradle.kts index 621efb1b97..eccae5e9bc 100644 --- a/tests/java-tests/build.gradle.kts +++ b/tests/java-tests/build.gradle.kts @@ -33,6 +33,7 @@ dependencies { testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion") testImplementation(testFixtures(project(":"))) // The root project testImplementation("org.junit.vintage:junit-vintage-engine:5.10.3") + testImplementation(project(":vim-engine", "testArtifacts")) intellijPlatform { create(ideaType, ideaVersion) diff --git a/tests/java-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/VimJavaTestCase.kt b/tests/java-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/VimJavaTestCase.kt index b1e0ab0a8b..f63c4bebf7 100644 --- a/tests/java-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/VimJavaTestCase.kt +++ b/tests/java-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/VimJavaTestCase.kt @@ -10,6 +10,6 @@ package org.jetbrains.plugins.ideavim import com.intellij.ide.highlighter.JavaFileType -abstract class VimJavaTestCase : VimTestCase() { +abstract class VimJavaTestCase : VimTestCaseBase() { protected fun configureByJavaText(content: String) = configureByText(JavaFileType.INSTANCE, content) } \ No newline at end of file diff --git a/tests/long-running-tests/build.gradle.kts b/tests/long-running-tests/build.gradle.kts index a1df0601d3..4e3ec8b6e1 100644 --- a/tests/long-running-tests/build.gradle.kts +++ b/tests/long-running-tests/build.gradle.kts @@ -26,6 +26,7 @@ dependencies { testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion") testImplementation(testFixtures(project(":"))) // The root project testImplementation("org.junit.vintage:junit-vintage-engine:5.10.3") + testImplementation(project(":vim-engine", "testArtifacts")) intellijPlatform { create(ideaType, ideaVersion) diff --git a/tests/long-running-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/longrunning/MacroTest.kt b/tests/long-running-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/longrunning/MacroTest.kt index bb17519852..df7054ab17 100644 --- a/tests/long-running-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/longrunning/MacroTest.kt +++ b/tests/long-running-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/longrunning/MacroTest.kt @@ -12,10 +12,10 @@ import com.intellij.testFramework.PlatformTestUtil import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MacroTest : VimTestCase() { +class MacroTest : VimTestCaseBase() { // was a problem on revision affec9bb61ea5e1e635673a0041d61f7af3722b2 @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) @Test diff --git a/tests/long-running-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/longrunning/MapCommandTest.kt b/tests/long-running-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/longrunning/MapCommandTest.kt index 86387f10e5..1bd3342955 100644 --- a/tests/long-running-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/longrunning/MapCommandTest.kt +++ b/tests/long-running-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/longrunning/MapCommandTest.kt @@ -11,10 +11,10 @@ package org.jetbrains.plugins.ideavim.longrunning import com.maddyhome.idea.vim.api.injector import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test -class MapCommandTest : VimTestCase() { +class MapCommandTest : VimTestCaseBase() { @TestWithoutNeovim(reason = SkipNeovimReason.NOT_VIM_TESTING) @Test fun `test double recursion`() { diff --git a/tests/property-tests/build.gradle.kts b/tests/property-tests/build.gradle.kts index 19c40d7b81..2e505f87b0 100644 --- a/tests/property-tests/build.gradle.kts +++ b/tests/property-tests/build.gradle.kts @@ -26,6 +26,7 @@ dependencies { testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion") testImplementation(testFixtures(project(":"))) // The root project testImplementation("org.junit.vintage:junit-vintage-engine:5.10.3") + testImplementation(project(":vim-engine", "testArtifacts")) intellijPlatform { create(ideaType, ideaVersion) diff --git a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/IncrementDecrementCheck.kt b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/IncrementDecrementCheck.kt index 1f0c8903a2..bca5274de7 100644 --- a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/IncrementDecrementCheck.kt +++ b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/IncrementDecrementCheck.kt @@ -12,13 +12,14 @@ import com.intellij.ide.IdeEventQueue import com.intellij.openapi.editor.Editor import com.intellij.testFramework.PlatformTestUtil import com.maddyhome.idea.vim.api.injector +import com.maddyhome.idea.vim.newapi.ij import org.jetbrains.jetCheck.Generator import org.jetbrains.jetCheck.ImperativeCommand import org.jetbrains.jetCheck.PropertyChecker import org.jetbrains.plugins.ideavim.NeovimTesting import org.jetbrains.plugins.ideavim.SkipNeovimReason import org.jetbrains.plugins.ideavim.TestWithoutNeovim -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.junit.jupiter.api.Test import kotlin.math.absoluteValue import kotlin.math.sign @@ -29,7 +30,7 @@ class IncrementDecrementTest : VimPropertyTestBase() { fun testPlayingWithNumbers() { PropertyChecker.checkScenarios { ImperativeCommand { env -> - val editor = configureByText(numbers) + val editor = configureByText(numbers).ij try { moveCaretToRandomPlace(env, editor) env.executeCommands(Generator.sampledFrom(IncrementDecrementActions(editor, this))) @@ -51,7 +52,7 @@ class IncrementDecrementTest : VimPropertyTestBase() { PropertyChecker.checkScenarios { ImperativeCommand { env -> val number = env.generateValue(testNumberGenerator, "Generate %s number") - val editor = configureByText(number) + val editor = configureByText(number).ij try { moveCaretToRandomPlace(env, editor) @@ -69,13 +70,13 @@ class IncrementDecrementTest : VimPropertyTestBase() { } } -private class IncrementDecrementActions(private val editor: Editor, val test: VimTestCase) : ImperativeCommand { +private class IncrementDecrementActions(private val editor: Editor, val test: VimTestCaseBase) : ImperativeCommand { override fun performCommand(env: ImperativeCommand.Environment) { val generator = Generator.sampledFrom("", "") val key = env.generateValue(generator, null) val action = injector.parser.parseKeys(key).single() env.logMessage("Use command: ${injector.parser.toKeyNotation(action)}.") - VimTestCase.typeText(listOf(action), editor, editor.project) + VimTestCaseBase.typeText(listOf(action), editor, editor.project) NeovimTesting.typeCommand(key, test.testInfo, editor) IdeEventQueue.getInstance().flushQueue() diff --git a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/MapPropertyTest.kt b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/MapPropertyTest.kt index 8f0568e1db..09ab646abf 100644 --- a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/MapPropertyTest.kt +++ b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/MapPropertyTest.kt @@ -9,6 +9,7 @@ package org.jetbrains.plugins.ideavim.propertybased import com.maddyhome.idea.vim.api.injector +import com.maddyhome.idea.vim.newapi.ij import org.jetbrains.jetCheck.Generator import org.jetbrains.jetCheck.ImperativeCommand import org.jetbrains.jetCheck.PropertyChecker @@ -22,7 +23,7 @@ class MapPropertyTest : VimPropertyTestBase() { fun /*test*/RandomMappings() { PropertyChecker.checkScenarios { ImperativeCommand { env -> - val editor = configureByText(simpleText) + val editor = configureByText(simpleText).ij try { editor.caretModel.moveToOffset(58) // At the word "lavender" diff --git a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/RandomActionsPropertyTest.kt b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/RandomActionsPropertyTest.kt index de661704fd..8f6bed04ff 100644 --- a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/RandomActionsPropertyTest.kt +++ b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/RandomActionsPropertyTest.kt @@ -15,11 +15,12 @@ import com.maddyhome.idea.vim.KeyHandler import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.api.key import com.maddyhome.idea.vim.key.CommandNode +import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.newapi.vim import org.jetbrains.jetCheck.Generator import org.jetbrains.jetCheck.ImperativeCommand import org.jetbrains.jetCheck.PropertyChecker -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.propertybased.samples.javaText import org.jetbrains.plugins.ideavim.propertybased.samples.loremText import org.junit.jupiter.api.Test @@ -36,7 +37,7 @@ class RandomActionsPropertyTest : VimPropertyTestBase() { fun testRandomActions() { PropertyChecker.checkScenarios { ImperativeCommand { env -> - val editor = configureByText(text) + val editor = configureByText(text).ij KeyHandler.getInstance().fullReset(editor.vim) try { moveCaretToRandomPlace(env, editor) @@ -52,7 +53,7 @@ class RandomActionsPropertyTest : VimPropertyTestBase() { fun testRandomActionsOnLoremIpsum() { PropertyChecker.checkScenarios { ImperativeCommand { env -> - val editor = configureByText(loremText) + val editor = configureByText(loremText).ij KeyHandler.getInstance().fullReset(editor.vim) try { moveCaretToRandomPlace(env, editor) @@ -68,7 +69,7 @@ class RandomActionsPropertyTest : VimPropertyTestBase() { fun testRandomActionsOnJavaCode() { PropertyChecker.checkScenarios { ImperativeCommand { env -> - val editor = configureByJavaText(javaText) + val editor = configureByJavaText(javaText).ij KeyHandler.getInstance().fullReset(editor.vim) try { moveCaretToRandomPlace(env, editor) @@ -105,7 +106,7 @@ private class AvailableActions(private val editor: Editor) : ImperativeCommand { val node = currentNode[usedKey] env.logMessage("Use command: ${injector.parser.toKeyNotation(usedKey)}. ${if (node is CommandNode) "Action: ${node.actionHolder.actionId}" else ""}") - VimTestCase.typeText(listOf(usedKey), editor, editor.project) + VimTestCaseBase.typeText(listOf(usedKey), editor, editor.project) IdeEventQueue.getInstance().flushQueue() PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue() diff --git a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/VimPropertyTestBase.kt b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/VimPropertyTestBase.kt index 0b2c975ebc..84cc24ef71 100644 --- a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/VimPropertyTestBase.kt +++ b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/VimPropertyTestBase.kt @@ -15,9 +15,9 @@ import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.newapi.vim import org.jetbrains.jetCheck.Generator import org.jetbrains.jetCheck.ImperativeCommand -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase -abstract class VimPropertyTestBase : VimTestCase() { +abstract class VimPropertyTestBase : VimTestCaseBase() { protected fun moveCaretToRandomPlace(env: ImperativeCommand.Environment, editor: Editor) { val pos = env.generateValue(Generator.integers(0, editor.document.textLength - 1), "Put caret at position %s") editor.caretModel.currentCaret.vim.moveToOffset(pos) diff --git a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/YankDeletePropertyTest.kt b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/YankDeletePropertyTest.kt index 1cb4f79dcd..b59af53f97 100644 --- a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/YankDeletePropertyTest.kt +++ b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/YankDeletePropertyTest.kt @@ -12,10 +12,11 @@ import com.intellij.ide.IdeEventQueue import com.intellij.openapi.editor.Editor import com.intellij.testFramework.PlatformTestUtil import com.maddyhome.idea.vim.api.injector +import com.maddyhome.idea.vim.newapi.ij import org.jetbrains.jetCheck.Generator import org.jetbrains.jetCheck.ImperativeCommand import org.jetbrains.jetCheck.PropertyChecker -import org.jetbrains.plugins.ideavim.VimTestCase +import org.jetbrains.plugins.ideavim.VimTestCaseBase import org.jetbrains.plugins.ideavim.propertybased.samples.loremText import org.junit.jupiter.api.Test @@ -24,7 +25,7 @@ class YankDeletePropertyTest : VimPropertyTestBase() { fun testYankDelete() { PropertyChecker.checkScenarios { ImperativeCommand { env -> - val editor = configureByText(loremText) + val editor = configureByText(loremText).ij try { moveCaretToRandomPlace(env, editor) env.executeCommands(Generator.sampledFrom(YankDeleteActions(editor))) @@ -41,7 +42,7 @@ private class YankDeleteActions(private val editor: Editor) : ImperativeCommand val key = env.generateValue(Generator.sampledFrom(keysList), null) env.logMessage("Use command: $key") - VimTestCase.typeText(injector.parser.parseKeys(key), editor, editor.project) + VimTestCaseBase.typeText(injector.parser.parseKeys(key), editor, editor.project) IdeEventQueue.getInstance().flushQueue() PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue() diff --git a/vim-engine/build.gradle.kts b/vim-engine/build.gradle.kts index e0417e205d..9826d41b47 100644 --- a/vim-engine/build.gradle.kts +++ b/vim-engine/build.gradle.kts @@ -22,6 +22,15 @@ val sourcesJarArtifacts by configurations.registering { } } +val testArtifacts: Configuration by configurations.creating { + extendsFrom(configurations.testImplementation.get()) +} + +val testJar by tasks.creating(Jar::class) { + archiveClassifier.set("tests") + from(sourceSets.test.get().output) +} + val kotlinVersion: String by project val kotlinxSerializationVersion: String by project @@ -109,6 +118,7 @@ java { } artifacts.add(sourcesJarArtifacts.name, tasks.named("sourcesJar")) +artifacts.add(testArtifacts.name, tasks.named("testJar")) val spaceUsername: String by project val spacePassword: String by project diff --git a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api/VimSearchGroupBase.kt b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api/VimSearchGroupBase.kt index c652852f03..5f24b35e7d 100644 --- a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api/VimSearchGroupBase.kt +++ b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api/VimSearchGroupBase.kt @@ -29,6 +29,7 @@ import com.maddyhome.idea.vim.regexp.match.VimMatchResult import com.maddyhome.idea.vim.register.RegisterConstants import com.maddyhome.idea.vim.state.mode.inVisualMode import com.maddyhome.idea.vim.vimscript.model.VimLContext +import com.maddyhome.idea.vim.vimscript.model.functions.handlers.SubmatchFunctionHandler import org.jetbrains.annotations.TestOnly import java.text.NumberFormat import java.text.ParsePosition @@ -137,24 +138,9 @@ abstract class VimSearchGroupBase : VimSearchGroup { * * @param match The match to save. */ - protected abstract fun setLatestMatch( - match: String, - ) - - /** - * Replaces a string in the editor. - * - * @param editor The editor where the replacement is to take place. - * @param startOffset The offset where the string that is to be replaced starts (inclusive). - * @param endOffset The offset where the string that is to be replaced ends (exclusive). - * @param newString The new string that will replace the old one. - */ - protected abstract fun replaceString( - editor: VimEditor, - startOffset: Int, - endOffset: Int, - newString: String, - ) + protected open fun setLatestMatch(match: String) { + SubmatchFunctionHandler.getInstance().latestMatch = match + } /** * Resets the variable that determines whether search highlights should be shown. @@ -814,7 +800,9 @@ abstract class VimSearchGroupBase : VimSearchGroup { if (doReplace) { val endPositionWithoutReplace = editor.offsetToBufferPosition(matchRange.endOffset) - replaceString(editor, matchRange.startOffset, matchRange.endOffset, finalMatch) + injector.application.runWriteAction { + (editor as MutableVimEditor).replaceString(matchRange.startOffset, matchRange.endOffset, finalMatch) + } didReplace = true val endPositionWithReplace = editor.offsetToBufferPosition(matchRange.startOffset + finalMatch.length) diff --git a/src/main/java/com/maddyhome/idea/vim/vimscript/model/functions/handlers/ColLineFunctionHandler.kt b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/functions/handlers/ColLineFunctionHandler.kt similarity index 91% rename from src/main/java/com/maddyhome/idea/vim/vimscript/model/functions/handlers/ColLineFunctionHandler.kt rename to vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/functions/handlers/ColLineFunctionHandler.kt index 0d4a86391c..bc71a1af97 100644 --- a/src/main/java/com/maddyhome/idea/vim/vimscript/model/functions/handlers/ColLineFunctionHandler.kt +++ b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/functions/handlers/ColLineFunctionHandler.kt @@ -1,5 +1,5 @@ /* - * Copyright 2003-2023 The IdeaVim authors + * Copyright 2003-2024 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 @@ -15,9 +15,6 @@ import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.api.lineLength import com.maddyhome.idea.vim.api.options import com.maddyhome.idea.vim.api.visualLineToBufferLine -import com.maddyhome.idea.vim.helper.EditorHelper -import com.maddyhome.idea.vim.helper.vimLine -import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.state.mode.inVisualMode import com.maddyhome.idea.vim.vimscript.model.VimLContext import com.maddyhome.idea.vim.vimscript.model.datatypes.VimDataType @@ -102,12 +99,12 @@ private fun variableToPosition(editor: VimEditor, variable: VimDataType, dollarF if (name.isEmpty()) return null // Current caret line - if (name[0] == '.') return editor.ij.vimLine.asVimInt() to currentCol(editor) + if (name[0] == '.') return editor.currentCaret().vimLine.asVimInt() to currentCol(editor) // Visual start if (name == "v") { if (!editor.inVisualMode) { - return editor.ij.vimLine.asVimInt() to currentCol(editor) + return editor.currentCaret().vimLine.asVimInt() to currentCol(editor) } val vimStart = editor.currentCaret().vimSelectionStart @@ -130,7 +127,7 @@ private fun variableToPosition(editor: VimEditor, variable: VimDataType, dollarF // First visual line if (name.length >= 2 && name[0] == 'w' && name[1] == '0') { if (!dollarForLine) return null - val actualVisualTop = EditorHelper.getVisualLineAtTopOfScreen(editor.ij) + val actualVisualTop = injector.engineEditorHelper.getVisualLineAtTopOfScreen(editor) val actualLogicalTop = editor.visualLineToBufferLine(actualVisualTop) return (actualLogicalTop + 1).asVimInt() to currentCol(editor) } @@ -138,7 +135,7 @@ private fun variableToPosition(editor: VimEditor, variable: VimDataType, dollarF // Last visual line if (name.length >= 2 && name[0] == 'w' && name[1] == '$') { if (!dollarForLine) return null - val actualVisualBottom = EditorHelper.getVisualLineAtBottomOfScreen(editor.ij) + val actualVisualBottom = injector.engineEditorHelper.getVisualLineAtBottomOfScreen(editor) val actualLogicalBottom = editor.visualLineToBufferLine(actualVisualBottom) return (actualLogicalBottom + 1).asVimInt() to currentCol(editor) } diff --git a/src/main/java/com/maddyhome/idea/vim/vimscript/model/functions/handlers/SubmatchFunctionHandler.kt b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/functions/handlers/SubmatchFunctionHandler.kt similarity index 93% rename from src/main/java/com/maddyhome/idea/vim/vimscript/model/functions/handlers/SubmatchFunctionHandler.kt rename to vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/functions/handlers/SubmatchFunctionHandler.kt index aa85c90cdd..392673379d 100644 --- a/src/main/java/com/maddyhome/idea/vim/vimscript/model/functions/handlers/SubmatchFunctionHandler.kt +++ b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/functions/handlers/SubmatchFunctionHandler.kt @@ -1,5 +1,5 @@ /* - * Copyright 2003-2023 The IdeaVim authors + * Copyright 2003-2024 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 @@ -20,7 +20,7 @@ import com.maddyhome.idea.vim.vimscript.model.expressions.Expression import com.maddyhome.idea.vim.vimscript.model.functions.FunctionHandler @VimscriptFunction(name = "submatch") -internal class SubmatchFunctionHandler : FunctionHandler() { +class SubmatchFunctionHandler : FunctionHandler() { override val minimumNumberOfArguments = 1 override val maximumNumberOfArguments = 2 diff --git a/vim-engine/src/main/resources/ksp-generated/engine_vimscript_functions.json b/vim-engine/src/main/resources/ksp-generated/engine_vimscript_functions.json index ff5db29720..270900e632 100644 --- a/vim-engine/src/main/resources/ksp-generated/engine_vimscript_functions.json +++ b/vim-engine/src/main/resources/ksp-generated/engine_vimscript_functions.json @@ -1,5 +1,6 @@ { "abs": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.AbsFunctionHandler", + "col": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.ColFunctionHandler", "empty": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.EmptyFunctionHandler", "exists": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.ExistsFunctionHandler", "funcref": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.FuncrefFunctionHandler", @@ -7,8 +8,10 @@ "get": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.GetFunctionHandler", "join": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.JoinFunctionHandler", "len": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.LenFunctionHandler", + "line": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.LineFunctionHandler", "sin": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.SinFunctionHandler", "split": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.SplitFunctionHandler", + "submatch": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.SubmatchFunctionHandler", "tolower": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.TolowerFunctionHandler", "toupper": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.ToupperFunctionHandler" } \ No newline at end of file diff --git a/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/SharedTestCaseList.kt b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/SharedTestCaseList.kt new file mode 100644 index 0000000000..0839cca2c9 --- /dev/null +++ b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/SharedTestCaseList.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2003-2024 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 com.maddyhome.idea.vim + +import com.maddyhome.idea.vim.model.SharedTestCase + +/** + * List of all shared test classes. + * Every IDE (Fleet, IJ-based, etc.) should have a successor to this class in its test files. + * When a new test is added to vim-engine (and listed in this class), compilation of tests in all IDEs will fail, + * requiring developers of the Vim plugin for each IDE to take action and implement the missing test. + * This class doesn't run any tests; it only declares them. + * Compilation errors resulting from this class will help IDE developers understand whether they have implemented all the vim-engine tests. + */ +interface SharedTestCaseList { + val insertDeleteActionTest: SharedTestCase + val deleteVisualLinesActionTest: SharedTestCase +} \ No newline at end of file diff --git a/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesActionTest.kt b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesActionTest.kt new file mode 100644 index 0000000000..0fc450160a --- /dev/null +++ b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesActionTest.kt @@ -0,0 +1,155 @@ +/* + * 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. + */ + +@file:Suppress("RemoveCurlyBracesFromTemplate") + +package com.maddyhome.idea.vim.action.change.delete + +import com.maddyhome.idea.vim.model.VimTestCase +import com.maddyhome.idea.vim.state.mode.Mode +import org.junit.jupiter.api.Test + +interface DeleteVisualLinesActionTest : VimTestCase { + @Test + fun `test remove line in char visual mode`() { + configureByText( + """ + I found ${c}it in a legendary land + consectetur adipiscing elit + Sed in orci mauris. + Cras id tellus in ex imperdiet egestas. + """.trimIndent(), + ) + typeText("vlllX") + assertState( + """ + ${c}consectetur adipiscing elit + Sed in orci mauris. + Cras id tellus in ex imperdiet egestas. + """.trimIndent(), + Mode.NORMAL() + ) + } + + @Test + fun `test remove line in char visual mode last line`() { + configureByText( + """ + Lorem ipsum dolor sit amet, + consectetur adipiscing elit + Sed in orci mauris. + hard by ${c}the torrent of a mountain pass. + """.trimIndent(), + ) + typeText("vlllX") + assertState( + """ + Lorem ipsum dolor sit amet, + consectetur adipiscing elit + ${c}Sed in orci mauris. + """.trimIndent(), + Mode.NORMAL(), + ) + } + + @Test + fun `test remove line in line visual mode`() { + configureByText( + """ + I found ${c}it in a legendary land + consectetur adipiscing elit + Sed in orci mauris. + Cras id tellus in ex imperdiet egestas. + """.trimIndent(), + ) + typeText("VX") + assertState( + """ + ${c}consectetur adipiscing elit + Sed in orci mauris. + Cras id tellus in ex imperdiet egestas. + """.trimIndent(), + Mode.NORMAL(), + ) + } + + @Test + fun `test remove line in line visual mode line end`() { + configureByText( + """ + Lorem ipsum dolor sit amet, + consectetur adipiscing elit + Sed in orci mauris. + hard by ${c}the torrent of a mountain pass. + """.trimIndent(), + ) + typeText("VX") + assertState( + """ + Lorem ipsum dolor sit amet, + consectetur adipiscing elit + ${c}Sed in orci mauris. + """.trimIndent(), + Mode.NORMAL(), + ) + } + + @Test + fun `test multiple line delete till the end`() { + configureByText( + """ + Lorem Ipsum + + Lorem ipsum dolor sit amet, + consectetur adipiscing elit + + ${c}Sed in orci mauris. + Cras id tellus in ex imperdiet egestas. + """.trimIndent() + ) + typeText("Vjd") + assertState( + """ + Lorem Ipsum + + Lorem ipsum dolor sit amet, + consectetur adipiscing elit + ${c} + """.trimIndent(), + Mode.NORMAL(), + ) + } + + @Test + fun `test multiple line delete till the end with a new line`() { + configureByText( + """ + Lorem Ipsum + + Lorem ipsum dolor sit amet, + consectetur adipiscing elit + + ${c}Sed in orci mauris. + Cras id tellus in ex imperdiet egestas. + + """.trimIndent() + ) + typeText("Vjd") + assertState( + """ + Lorem Ipsum + + Lorem ipsum dolor sit amet, + consectetur adipiscing elit + + ${c} + """.trimIndent(), + Mode.NORMAL(), + ) + } +} diff --git a/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/action/change/insert/InsertDeleteActionTest.kt b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/action/change/insert/InsertDeleteActionTest.kt new file mode 100644 index 0000000000..3a5182be37 --- /dev/null +++ b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/action/change/insert/InsertDeleteActionTest.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2003-2024 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 com.maddyhome.idea.vim.action.change.insert + +import com.maddyhome.idea.vim.model.VimTestCase +import org.junit.jupiter.api.Test + +interface InsertDeleteActionTest : VimTestCase { + @Test + fun `test insert delete`() { + val before = "I fo${c}und it in a legendary land" + val after = "I fo${c}nd it in a legendary land" + configureByText(before) + typeText("i", "") + + assertState(after) + } +} diff --git a/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/EmptyTestCase.kt b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/EmptyTestCase.kt new file mode 100644 index 0000000000..9344b62a3e --- /dev/null +++ b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/EmptyTestCase.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2003-2024 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 com.maddyhome.idea.vim.model + +/** + * A stub that can be placed in the [SharedTestCaseList] to resolve compilation issues + * when there's insufficient time or ability to implement a proper test case. + * This class can be used to temporarily stub unimplemented functionality in cases where, + * due to varying development speeds, one of the IDEs hasn't fully implemented vim-engine features. + * It serves as a placeholder, allowing compilation to succeed while marking areas that need future attention. + */ +class EmptyTestCase : SharedTestCase \ No newline at end of file diff --git a/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/FileType.kt b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/FileType.kt new file mode 100644 index 0000000000..1ec21c9630 --- /dev/null +++ b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/FileType.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2003-2024 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 com.maddyhome.idea.vim.model + +enum class FileType { + PLAIN_TEXT, + XML, + JSON, +} \ No newline at end of file diff --git a/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/SharedTestCase.kt b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/SharedTestCase.kt new file mode 100644 index 0000000000..a3876f98ee --- /dev/null +++ b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/SharedTestCase.kt @@ -0,0 +1,14 @@ +/* + * Copyright 2003-2024 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 com.maddyhome.idea.vim.model + +/** + * Test class without IDE-specific functionality that should be run in all IDEs + */ +interface SharedTestCase \ No newline at end of file diff --git a/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/VimTestCase.kt b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/VimTestCase.kt new file mode 100644 index 0000000000..2610ee85b9 --- /dev/null +++ b/vim-engine/src/test/kotlin/com/maddyhome/idea/vim/model/VimTestCase.kt @@ -0,0 +1,219 @@ +/* + * Copyright 2003-2024 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 com.maddyhome.idea.vim.model + +import com.maddyhome.idea.vim.api.BufferPosition +import com.maddyhome.idea.vim.api.VimEditor +import com.maddyhome.idea.vim.api.VimVisualPosition +import com.maddyhome.idea.vim.api.injector +import com.maddyhome.idea.vim.api.visualLineToBufferLine +import com.maddyhome.idea.vim.ex.ExException +import com.maddyhome.idea.vim.state.mode.Mode +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Assertions.assertNotNull +import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.assertThrows +import javax.swing.KeyStroke +import kotlin.test.assertNull +import kotlin.test.assertContains + +interface VimTestCase : SharedTestCase { + val c: String + val editor: VimEditor + + fun assertEmpty(collection: Collection) { + assertTrue(collection.isEmpty(), "Collection should be empty, but it contains ${collection.size} elements") + } + + fun typeTextInFile(keys: List, fileContents: String): VimEditor { + configureByText(fileContents) + return typeText(keys) + } + + fun typeTextInFile(keys: String, fileContents: String): VimEditor { + configureByText(fileContents) + return typeText(keys) + } + + fun configureByText(content: String) = configureByText(FileType.PLAIN_TEXT, content) + fun configureByXmlText(content: String) = configureByText(FileType.XML, content) + fun configureByJsonText(@Suppress("SameParameterValue") content: String) = configureByText(FileType.JSON, content) + + fun configureByText(fileType: FileType, content: String): VimEditor + + // TODO rename, it does not 'type' + fun typeText(vararg keys: String) = typeText(keys.flatMap { injector.parser.parseKeys(it) }) + + fun typeText(keys: List): VimEditor { + return typeText(editor, keys) + } + + fun typeText(editor: VimEditor, keys: List): VimEditor + + fun enterCommand(command: String): VimEditor { + return typeText(commandToKeys(command)) + } + + fun enterSearch(pattern: String, forwards: Boolean = true): VimEditor { + return typeText(searchToKeys(pattern, forwards)) + } + + fun assertState(textAfter: String) + fun assertState(textAfter: String, modeAfter: Mode) + + fun assertRegister(char: Char, expected: String?) { + val actual = injector.registerGroup.getRegister(char)?.keys?.let(injector.parser::toKeyNotation) + assertEquals(expected, actual, "Wrong register contents") + } + + fun assertRegisterString(char: Char, expected: String?) { + val actual = injector.registerGroup.getRegister(char)?.keys?.let(injector.parser::toPrintableString) + assertEquals(expected, actual, "Wrong register contents") + } + + fun assertState(modeAfter: Mode) { + assertMode(modeAfter) + assertCaretsVisualAttributes() + } + + fun assertPosition(line: Int, column: Int) { + val carets = editor.carets() + assertEquals(1, carets.size, "Wrong amount of carets") + val actualPosition = carets[0].getBufferPosition() + assertEquals(BufferPosition(line, column), actualPosition) + } + + fun assertVisualPosition(visualLine: Int, visualColumn: Int) { + val carets = editor.carets() + assertEquals(1, carets.size, "Wrong amount of carets") + val actualPosition = carets[0].getVisualPosition() + assertEquals(VimVisualPosition(visualLine, visualColumn), actualPosition) + } + + fun assertOffset(vararg expectedOffsets: Int) { + val carets = editor.carets().sortedBy { it.offset } + if (expectedOffsets.size == 2 && carets.size == 1) { + assertEquals( + expectedOffsets.size, + carets.size, + "Wrong amount of carets. Did you mean to use assertPosition?", + ) + } + assertEquals(expectedOffsets.size, carets.size, "Wrong amount of carets") + for (i in expectedOffsets.indices) { + assertEquals(expectedOffsets[i], carets[i].offset) + } + } + + fun assertOffsetAt(text: String) { + val indexOf = editor.text().indexOf(text) + if (indexOf < 0) kotlin.test.fail() + assertOffset(indexOf) + } + + // Use logical rather than visual lines, so we can correctly test handling of collapsed folds and soft wraps + fun assertVisibleArea(topLogicalLine: Int, bottomLogicalLine: Int) { + assertTopLogicalLine(topLogicalLine) + assertBottomLogicalLine(bottomLogicalLine) + } + + fun assertTopLogicalLine(topLogicalLine: Int) { + val actualVisualTop = injector.engineEditorHelper.getVisualLineAtTopOfScreen(editor) + val actualLogicalTop = editor.visualLineToBufferLine(actualVisualTop) + + assertEquals(topLogicalLine, actualLogicalTop, "Top logical lines don't match") + } + + fun assertBottomLogicalLine(bottomLogicalLine: Int) { + val actualVisualBottom = injector.engineEditorHelper.getVisualLineAtBottomOfScreen(editor) + val actualLogicalBottom = editor.visualLineToBufferLine(actualVisualBottom) + + assertEquals(bottomLogicalLine, actualLogicalBottom, "Bottom logical lines don't match") + } + + fun assertMode(expectedMode: Mode) { + assertEquals(expectedMode, editor.mode) + } + + fun assertCommandOutput(command: String, expected: String) { + enterCommand(command) + assertExOutput(expected) + } + + fun assertExOutput(expected: String) { + val outputPanel = injector.outputPanel.getCurrentOutputPanel() + assertNotNull(outputPanel, "No output panel") + val actual = outputPanel!!.text + assertEquals(expected, actual) + } + + fun assertNoExOutput() { + val outputPanel = injector.outputPanel.getCurrentOutputPanel() + assertNull(outputPanel) + } + + fun assertPluginError(isError: Boolean) { + assertEquals(isError, injector.messages.isError()) + } + + fun assertPluginErrorMessageContains(message: String) { + assertContains(injector.messages.getStatusBarMessage()!!, message) + } + + fun assertStatusLineMessageContains(message: String) { + assertContains(injector.messages.getStatusBarMessage()!!, message) + } + + fun assertStatusLineCleared() { + assertNull(injector.messages.getStatusBarMessage()) + } + + fun assertCaretsVisualAttributes() + + fun performTest(keys: String, after: String, modeAfter: Mode) { + typeText(keys) + assertState(after) + assertState(modeAfter) + } + + fun setRegister(register: Char, keys: String) { + injector.registerGroup.setKeys(register, injector.parser.stringToKeys(keys)) + } + + fun assertExException(expectedErrorMessage: String, action: () -> Unit) { + val exception = assertThrows { action() } + assertEquals(expectedErrorMessage, exception.message) + } + + fun exCommand(command: String) = ":$command" + + fun commandToKeys(command: String): List { + val keys: MutableList = ArrayList() + if (!command.startsWith(":")) { + keys.addAll(injector.parser.parseKeys(":")) + } + keys.addAll(injector.parser.stringToKeys(command)) // Avoids trying to parse 'command ... ' as a special char + keys.addAll(injector.parser.parseKeys("")) + return keys + } + + fun searchToKeys(pattern: String, forwards: Boolean): List { + val keys: MutableList = ArrayList() + keys.addAll(injector.parser.parseKeys(if (forwards) "/" else "?")) + keys.addAll(injector.parser.stringToKeys(pattern)) // Avoids trying to parse 'command ... ' as a special char + keys.addAll(injector.parser.parseKeys("")) + return keys + } + + fun searchCommand(pattern: String) = "$pattern" + + fun String.dotToTab(): String = replace('.', '\t') + + fun String.dotToSpace(): String = replace('.', ' ') +} \ No newline at end of file