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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add documentation
  • Loading branch information
lippfi committed Aug 30, 2024
commit 5f19d7b4b9cff1ced3e4fd2be86e2a40d9cea24e
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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

/**
* 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.
*/
abstract class SharedTestCaseList {
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import javax.swing.KeyStroke
import kotlin.test.assertNull
import kotlin.test.assertContains

interface VimTestCase {
interface VimTestCase : SharedTestCase {
val editor: VimEditor

fun <T> assertEmpty(collection: Collection<T>) {
Expand Down