Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared tests #981

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Rename VimTestCase to VimTestCaseBase
  • Loading branch information
lippfi committed Aug 30, 2024
commit 62a29a0a58e0d0846dafb5c5baaea0bd9e7158e5
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.jetbrains.plugins.ideavim.impl.OptionTest
import org.jetbrains.plugins.ideavim.impl.VimOption
import org.junit.jupiter.api.Test

class RegisterActionsTest : VimTestCase() {
class RegisterActionsTest : VimTestCaseBase() {
@OptionTest(
VimOption(TestOptionConstants.virtualedit, doesntAffectTest = true),
VimOption(TestOptionConstants.whichwrap, doesntAffectTest = true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ActionsTest : VimTestCase() {
class ActionsTest : VimTestCaseBase() {
@Test
@TestFor(issues = ["VIM-3203"])
@TestWithoutNeovim(SkipNeovimReason.NOT_VIM_TESTING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ChangeActionTest : VimTestCase() {
class ChangeActionTest : VimTestCaseBase() {
// VIM-620 |i_CTRL-O|
@Test
fun testInsertSingleCommandAndInserting() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ package org.jetbrains.plugins.ideavim.action

import com.google.common.collect.Lists
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 ChangeNumberActionTest : VimTestCase() {
class ChangeNumberActionTest : VimTestCaseBase() {
@Test
fun testIncrementDecimalZero() {
doTest("<C-A>", "0", "1", Mode.NORMAL())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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.jetbrains.plugins.ideavim.waitAndAssert
import org.junit.jupiter.api.Test
import kotlin.test.assertNotNull
Expand All @@ -24,7 +24,7 @@ import kotlin.test.assertTrue
* @author vlan
*/
@Suppress("SpellCheckingInspection")
class CopyActionTest : VimTestCase() {
class CopyActionTest : VimTestCaseBase() {
// |y| |p| |count|
@Test
fun testYankPutCharacters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +32,7 @@ import kotlin.test.assertTrue
/**
* @author vlan
*/
class MacroActionTest : VimTestCase() {
class MacroActionTest : VimTestCaseBase() {

@AfterEach
fun tearDown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import com.maddyhome.idea.vim.newapi.IjVimEditor
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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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^", ".")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<esc>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("<C-X>", "0x0000", "0xffffffffffffffff", Mode.NORMAL())
Expand Down
Loading