diff --git a/build.gradle.kts b/build.gradle.kts index 209ff7a64..7412250e6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -96,7 +96,7 @@ dependencies { testFramework(TestFrameworkType.Platform) testFramework(TestFrameworkType.Plugin.Java) - intellijIdeaCommunity("2024.2.3") + intellijIdeaCommunity("2024.3.1") // Docs: https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties // All snapshot versions: https://www.jetbrains.com/intellij-repository/snapshots/ diff --git a/src/nl/hannahsten/texifyidea/run/bibtex/BibtexSettingsEditor.kt b/src/nl/hannahsten/texifyidea/run/bibtex/BibtexSettingsEditor.kt index f029f3450..0b3ea053c 100644 --- a/src/nl/hannahsten/texifyidea/run/bibtex/BibtexSettingsEditor.kt +++ b/src/nl/hannahsten/texifyidea/run/bibtex/BibtexSettingsEditor.kt @@ -2,7 +2,7 @@ package nl.hannahsten.texifyidea.run.bibtex import com.intellij.execution.configuration.EnvironmentVariablesComponent import com.intellij.openapi.fileChooser.FileChooserDescriptor -import com.intellij.openapi.fileChooser.FileTypeDescriptor +import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory import com.intellij.openapi.options.SettingsEditor import com.intellij.openapi.project.Project import com.intellij.openapi.roots.ProjectRootManager @@ -108,7 +108,9 @@ class BibtexSettingsEditor(private val project: Project) : SettingsEditor$absoluteWorkingPath/test/resources/completion/path/myPicture.myinvalidextension}""") - myFixture.checkHighlighting() + // Avoid "VfsRootAccess$VfsRootAccessNotAllowedError: File accessed outside allowed roots" on Windows in github actions + if (!SystemInfo.isWindows) { + myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/completion/path/myPicture.myinvalidextension}""") + myFixture.checkHighlighting() + } } fun testValidAbsolutePath() { - myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/completion/path/myPicture.png}""") + if (!SystemInfo.isWindows) { + myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/completion/path/myPicture.png}""") - myFixture.checkHighlighting() + myFixture.checkHighlighting() + } } fun testValidAbsolutePathCaps() { - myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/inspections/latex/filenotfound/myOtherPicture.PNG}""") - myFixture.checkHighlighting() + if (!SystemInfo.isWindows) { + myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/inspections/latex/filenotfound/myOtherPicture.PNG}""") + myFixture.checkHighlighting() + } } fun testBackActionAbsolute() { - myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/completion/path/../path/../path/myPicture.png}""") - myFixture.checkHighlighting() + if (!SystemInfo.isWindows) { + myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/completion/path/../path/../path/myPicture.png}""") + myFixture.checkHighlighting() + } } fun testCurrDirActionAbsolute() { - myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/./resources/./././completion/path/././myPicture.png}""") - myFixture.checkHighlighting() + if (!SystemInfo.isWindows) { + myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/./resources/./././completion/path/././myPicture.png}""") + myFixture.checkHighlighting() + } } fun testAbsoluteGraphicsDirWithInclude() { @@ -81,19 +96,25 @@ class LatexFileNotFoundInspectionTest : TexifyInspectionTestBase(LatexFileNotFou } fun testDefaultExtensionCompletion() { - myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/completion/path/myPicture}""") - myFixture.checkHighlighting() + if (!SystemInfo.isWindows) { + myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/completion/path/myPicture}""") + myFixture.checkHighlighting() + } } fun testDefaultUpperCaseExtensionCompletion() { - myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/inspections/latex/filenotfound/myOtherPicture}""") - myFixture.checkHighlighting() + if (!SystemInfo.isWindows) { + myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/inspections/latex/filenotfound/myOtherPicture}""") + myFixture.checkHighlighting() + } } fun testDefaultMixedCaseExtensionCompletion() { - myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/completion/path/myBadPicture}""") + if (!SystemInfo.isWindows) { + myFixture.configureByText(LatexFileType, """\includegraphics{$absoluteWorkingPath/test/resources/completion/path/myBadPicture}""") - myFixture.checkHighlighting() + myFixture.checkHighlighting() + } } fun testNoWarningInDefinition() { diff --git a/test/nl/hannahsten/texifyidea/refactoring/InlineFileTest.kt b/test/nl/hannahsten/texifyidea/refactoring/InlineFileTest.kt index d2a3f68e9..1bc3243bc 100644 --- a/test/nl/hannahsten/texifyidea/refactoring/InlineFileTest.kt +++ b/test/nl/hannahsten/texifyidea/refactoring/InlineFileTest.kt @@ -6,10 +6,8 @@ import com.intellij.openapi.util.io.FileUtilRt import com.intellij.openapi.vfs.CharsetToolkit import com.intellij.psi.PsiFileFactory import com.intellij.refactoring.BaseRefactoringProcessor.ConflictsInTestsException -import com.intellij.refactoring.MockInlineMethodOptions import com.intellij.refactoring.inline.InlineOptions import com.intellij.testFramework.LightPlatformCodeInsightTestCase -import junit.framework.TestCase import nl.hannahsten.texifyidea.file.LatexFileType import nl.hannahsten.texifyidea.refactoring.inlinecommand.LatexInlineCommandHandler.Util.getReference import nl.hannahsten.texifyidea.refactoring.inlinefile.LatexInlineFileHandler.Util.canInlineLatexElement @@ -127,7 +125,7 @@ class InlineFileTest : LightPlatformCodeInsightTestCase() { private fun configure(testIndex: Int? = null): String { @NonNls val fileName = getTestName(false) + (testIndex ?: "") + ".tex" configureByFile(fileName) - TestCase.assertTrue(file.parent != null) + assertTrue(file.parent != null) if (file.parent?.children?.any { it.containingFile.name == inlineFile } == false) { val ioFile = File(testDataPath + inlineFile) checkCaseSensitiveFS(testDataPath + inlineFile, ioFile) @@ -182,4 +180,12 @@ class InlineFileTest : LightPlatformCodeInsightTestCase() { ) processor.run() } + + open class MockInlineMethodOptions : InlineOptions { + override fun isInlineThisOnly() = false + + override fun close(p0: Int) {} + + override fun isPreviewUsages() = false + } } \ No newline at end of file