Skip to content

Commit

Permalink
Add tests for #3847
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPirates committed Jan 10, 2025
1 parent 7bcb903 commit d9d023f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ object LatexLogMessageExtractor {

// Look for errors that need special treatment.
specialErrorHandlersList.forEach { handler ->
if (handler.regex.any { it.containsMatchIn(text) }) {
if (handler.regex.any { it.containsMatchIn(textToMatch) }) {
return handler.findMessage(text, newText, currentFile)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class LatexOutputListenerTest : BasePlatformTestCase() {
""".trimIndent()

val expectedMessages = setOf(
LatexLogMessage("Undefined control sequence. \\PrintVersion", "config/constants.tex", 70, ERROR)
LatexLogMessage("Undefined control sequence. \\IsTrue", "config/constants.tex", 70, ERROR)
)

testLog(log, expectedMessages)
Expand Down Expand Up @@ -857,4 +857,54 @@ Latexmk: Summary of warnings from last run of *latex:

testLog(log, expectedMessages)
}

fun `test updmap`() {
val log =
"""
(./0_main.tex
LaTeX2e <2024-11-01> patch level 1
L3 programming layer <2024-12-25>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2024/06/29 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(/Users/neal/Desktop/mwe/out/0_main.aux)
[1{/usr/local/texlive/2024/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
./0_main.tex:23: Undefined control sequence.
l.23 \asd
""".trimIndent()

val expectedMessages = setOf(
LatexLogMessage("Undefined control sequence. \\asd", "./0_main.tex", 23, ERROR),
)

testLog(log, expectedMessages)
}

fun `test long file name`() {
val log =
"""
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(/home/thomas/GitRepos/random-tex-empty/src/main.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-09-10>
(/home/thomas/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2024/06/29 v1.4n Standard LaTeX document class
(/home/thomas/texlive/2024/texmf-dist/tex/latex/base/size10.clo))
(/home/thomas/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(/home/thomas/GitRepos/random-tex-empty/out/main.aux)
[1{/home/thomas/texlive/2024/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
/home/thomas/GitRepos/random-tex-empty/src/main.tex:22: Undefined control seque
nce.
l.22 \asd
""".trimIndent()

val expectedMessages = setOf(
LatexLogMessage("Undefined control sequence. \\asd", "main.tex", 22, ERROR),
)

testLog(log, expectedMessages)
}
}

0 comments on commit d9d023f

Please sign in to comment.