Verify narrow-measure pretolerance against pdfLaTeX

This commit is contained in:
gloamxun committed 2026-10-24 00:07:26 +08:00
1 parent 01ed1b7c21
commit c3bb8af8a9
3 files changed
+27 -9

No files matched your search

+18
View File
@@ -421,6 +421,24 @@ fn tolerance_10000_matches_pdftex() {
}
}
/// A narrow measure exercises TeX's `\pretolerance` pass: loose one-word
/// lines are feasible there, so the breaker must not hyphenate them itself.
#[test]
fn narrow_measure_pretolerance_matches_pdftex() {
let text = "hyphenation demonstrates discretionary representation according extraordinary understanding";
for width in [70, 85] {
compare_fixture_with(
text,
width,
"\\pretolerance=10000 \\tolerance=200 ",
|style| {
style.pretolerance = 10_000;
style.tolerance = 200;
},
);
}
}
/// `\hyphenpenalty=10000` makes hyphenation illegal, so the final pass keeps
/// overfull lines instead.
#[test]