Skip to content

Commit 2e16fca

Browse files
committed
Add missing tests from tinytex R package known errors
1 parent 8d529c7 commit 2e16fca

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/unit/latexmk/parse-error.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,29 @@ unitTest("Detect missing files with `findMissingFontsAndPackages`", async () =>
4949
assertFound("! I can't find file `hyph-de-1901.ec.tex'.", "hyph-de-1901.ec.tex");
5050
assertFound("luaotfload-features.lua:835: module 'lua-uni-normalize' not found:", "lua-uni-algos.lua");
5151
assertFound("! LuaTeX-ja error: File 'jfm-zh_CN.lua' not found.", "jfm-zh_CN.lua");
52+
53+
// Additional test cases from tinytex R package examples (latex.R lines 537-607)
54+
// https://github.com/rstudio/tinytex/blob/e96be3143b9af07768a124215b5fb5a1e6d183d3/R/latex.R#L538-L558
55+
// xdvipdfmx variant of TFM error
56+
assertFound('xdvipdfmx:fatal: Unable to find TFM file "rsfs10"', fontSearchTerm("rsfs10"));
57+
// biblatex bibliography style file
58+
assertFound("Package biblatex Info: ... file 'trad-abbrv.bbx' not found", "trad-abbrv.bbx");
59+
// epstopdf - eps-converted-to.pdf pattern
60+
assertFound("! Package pdftex.def Error: File `logo-mdpi-eps-converted-to.pdf' not found", "epstopdf");
61+
// epstopdf - pdf_ref_obj pattern
62+
assertFound("! xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object.", "epstopdf");
63+
// tikz library with error context
64+
assertFound(
65+
"! Package tikz Error: I did not find the tikz library 'hobby'. This error message was issued because the library or one of its sublibraries could not be found, probably because of a misspelling. Processed options: \"library={hobby}\". The possibly misspelled library name is \"hobby\". The library name should be one of the following (or you misspelled it): named tikzlibraryhobby.code.tex",
66+
"tikzlibraryhobby.code.tex"
67+
);
68+
// support file missing
69+
assertFound("support file `supp-pdf.mkii' (supp-pdf.tex) is missing", "supp-pdf.mkii");
70+
71+
// Note: The following error types from tinytex are not yet testable because
72+
// patterns don't exist in parse-error.ts:
73+
// - .fd files: "No file LGRcmr.fd. ! LaTeX Error: This NFSS system isn't set up properly."
74+
// - pdfx color profiles: "! Package pdfx Error: No color profile sRGB_IEC61966-2-1_black_scaled.icc found"
5275
},{
5376
cwd: () => "unit/latexmk/"
5477
})

0 commit comments

Comments
 (0)