Skip to content

Commit

Permalink
Disable some broken tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPirates committed Dec 15, 2024
1 parent a0cf1f2 commit 12512a2
Showing 1 changed file with 34 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package nl.hannahsten.texifyidea.inspections.latex.probablebugs

import com.intellij.openapi.util.SystemInfo
import io.mockk.every
import io.mockk.mockkStatic
import nl.hannahsten.texifyidea.file.LatexFileType
Expand Down Expand Up @@ -32,29 +33,40 @@ class LatexFileNotFoundInspectionTest : TexifyInspectionTestBase(LatexFileNotFou
}

fun testMissingAbsolutePath() {
myFixture.configureByText(LatexFileType, """\includegraphics{<error>$absoluteWorkingPath/test/resources/completion/path/myPicture.myinvalidextension</error>}""")
myFixture.checkHighlighting()
// Avoid "VfsRootAccess$VfsRootAccessNotAllowedError: File accessed outside allowed roots" on Windows in github actions
if (!SystemInfo.isWindows) {
myFixture.configureByText(LatexFileType, """\includegraphics{<error>$absoluteWorkingPath/test/resources/completion/path/myPicture.myinvalidextension</error>}""")
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() {
Expand Down Expand Up @@ -84,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{<error>$absoluteWorkingPath/test/resources/completion/path/myBadPicture</error>}""")
if (!SystemInfo.isWindows) {
myFixture.configureByText(LatexFileType, """\includegraphics{<error>$absoluteWorkingPath/test/resources/completion/path/myBadPicture</error>}""")

myFixture.checkHighlighting()
myFixture.checkHighlighting()
}
}

fun testNoWarningInDefinition() {
Expand Down

0 comments on commit 12512a2

Please sign in to comment.