diff --git a/test/org/jetbrains/plugins/hocon/editor/HoconEditorActionTest.scala b/test/org/jetbrains/plugins/hocon/editor/HoconEditorActionTest.scala index 0dd6cf2..22ef295 100644 --- a/test/org/jetbrains/plugins/hocon/editor/HoconEditorActionTest.scala +++ b/test/org/jetbrains/plugins/hocon/editor/HoconEditorActionTest.scala @@ -8,10 +8,8 @@ import com.intellij.psi.PsiFile import com.intellij.testFramework.EditorTestUtil import org.junit.Assert.assertNotNull -abstract class HoconEditorActionTest protected( - override protected val actionId: String, - subPath: String -) extends HoconActionTest(actionId, subPath) { +abstract class HoconEditorActionTest(actionId: String, subPath: String) + extends HoconActionTest(actionId, subPath) { override protected def executeAction(dataContext: DataContext, editor: Editor): Unit = { val actionHandler = EditorActionManager.getInstance.getActionHandler(actionId) diff --git a/test/org/jetbrains/plugins/hocon/navigation/HoconNavigationTest.scala b/test/org/jetbrains/plugins/hocon/navigation/HoconNavigationTest.scala new file mode 100644 index 0000000..3aa3787 --- /dev/null +++ b/test/org/jetbrains/plugins/hocon/navigation/HoconNavigationTest.scala @@ -0,0 +1,24 @@ +package org.jetbrains.plugins.hocon +package navigation + +import com.intellij.openapi.editor.Editor +import com.intellij.psi.PsiFile + +abstract class HoconNavigationTest(actionId: String, subPath: String) + extends HoconActionTest(actionId, subPath) { + protected def extractResult(file: PsiFile, editor: Editor): String = { + val lp = editor.getCaretModel.getLogicalPosition + s"${lp.line + 1}:${lp.column + 1}" + } +} + +import com.intellij.openapi.actionSystem.IdeActions + +class HoconSubstitutionResolutionTest extends HoconNavigationTest(IdeActions.ACTION_GOTO_DECLARATION, "substitution") +object HoconSubstitutionResolutionTest extends TestSuiteCompanion[HoconSubstitutionResolutionTest] + +class HoconGoToNextTest extends HoconNavigationTest("HoconGotoNext", "gotoNext") +object HoconGoToNextTest extends TestSuiteCompanion[HoconGoToNextTest] + +class HoconGoToPrevTest extends HoconNavigationTest("HoconGotoPrev", "gotoPrev") +object HoconGoToPrevTest extends TestSuiteCompanion[HoconGoToPrevTest] \ No newline at end of file diff --git a/test/org/jetbrains/plugins/hocon/resolution/HoconSubstitutionResolutionTest.scala b/test/org/jetbrains/plugins/hocon/resolution/HoconSubstitutionResolutionTest.scala deleted file mode 100644 index 3bbbadd..0000000 --- a/test/org/jetbrains/plugins/hocon/resolution/HoconSubstitutionResolutionTest.scala +++ /dev/null @@ -1,14 +0,0 @@ -package org.jetbrains.plugins.hocon -package resolution - -import com.intellij.openapi.actionSystem.IdeActions -import com.intellij.openapi.editor.Editor -import com.intellij.psi.PsiFile - -class HoconSubstitutionResolutionTest extends HoconActionTest(IdeActions.ACTION_GOTO_DECLARATION, "substitution") { - protected def extractResult(file: PsiFile, editor: Editor): String = { - val lp = editor.getCaretModel.getLogicalPosition - s"${lp.line + 1}:${lp.column + 1}" - } -} -object HoconSubstitutionResolutionTest extends TestSuiteCompanion[HoconSubstitutionResolutionTest] \ No newline at end of file diff --git a/testdata/actions/gotoNext/simple.test b/testdata/actions/gotoNext/simple.test new file mode 100644 index 0000000..7c20ce1 --- /dev/null +++ b/testdata/actions/gotoNext/simple.test @@ -0,0 +1,4 @@ +a = 5 +a = 10 +----- +2:1 \ No newline at end of file diff --git a/testdata/actions/gotoPrev/simple.test b/testdata/actions/gotoPrev/simple.test new file mode 100644 index 0000000..05720f0 --- /dev/null +++ b/testdata/actions/gotoPrev/simple.test @@ -0,0 +1,4 @@ +a = 5 +a = 10 +----- +1:1 \ No newline at end of file