package nl.hannahsten.texifyidea.inspections.latex

import nl.hannahsten.texifyidea.file.LatexFileType
import nl.hannahsten.texifyidea.inspections.TexifyInspectionTestBase
import org.junit.Test
import java.nio.file.Path
import java.nio.file.Paths

class LatexAbsolutePathInspectionTest : TexifyInspectionTestBase(LatexAbsolutePathInspection()) {
    var absoluteWorkingPath: String

    init {
        val currentRelativePath: Path = Paths.get("")
        absoluteWorkingPath = currentRelativePath.toAbsolutePath().toString()
    }

    @Test
    fun testNotSupportedAbsolutePath() {
        myFixture.configureByText(LatexFileType, """<error>\include{$absoluteWorkingPath/test/resources/completion/path/testfile.tex}</error>""")
        myFixture.checkHighlighting()
    }
}
package nl.hannahsten.texifyidea.inspections.latex

import nl.hannahsten.texifyidea.file.LatexFileType
import nl.hannahsten.texifyidea.inspections.TexifyInspectionTestBase
import org.junit.Test
import java.nio.file.Path
import java.nio.file.Paths

class LatexAbsolutePathInspectionTest : TexifyInspectionTestBase(LatexAbsolutePathInspection()) {
    var absoluteWorkingPath: String

    init {
        val currentRelativePath: Path = Paths.get("")
        absoluteWorkingPath = currentRelativePath.toAbsolutePath().toString()
    }

    @Test
    fun testNotSupportedAbsolutePath() {
        myFixture.configureByText(LatexFileType, """\include{<error descr="No absolute path allowed here">$absoluteWorkingPath/test/resources/completion/path/testfile.tex</error>}""")
        myFixture.checkHighlighting()
    }

    @Test
    fun testNotSupportedAbsolutePathAsSecondParameter() {
        myFixture.configureByText(LatexFileType, """\import{/absolute/path/to/}{<error descr="No absolute path allowed here">$absoluteWorkingPath/test/resources/completion/path/testfile.tex</error>}""")
        myFixture.checkHighlighting()
    }
}
Fix absolute path inspection test
Fix absolute path inspection test

Ruben-Sten/TeXiFy-IDEA,Ruben-Sten/TeXiFy-IDEA,Ruben-Sten/TeXiFy-IDEA,Ruben-Sten/TeXiFy-IDEA