Shrink overfull final lines and widen the oracle matrix

This commit is contained in:
gloamxun committed 2026-10-23 02:45:11 +08:00
1 parent bcd3b6fa66
commit 6305f059ac
5 files changed
+98 -50

No files matched your search

+22 -4
View File
@@ -406,12 +406,30 @@ fn paragraph_breaks_match_pdftex_at_180pt() {
compare_fixture(WORDS, 180);
}
/// Several measures in one run: 100/120pt exercise hyphenated and overfull
/// breaks, 150pt needs TeX's final-pass overfull box, and 180/200/240pt are
/// ordinary tolerance solutions.
/// Several measures in one run: 90/100/110/120pt exercise hyphenated and
/// overfull breaks, 130/150/160pt need TeX's final-pass overfull box, and
/// 180/200/220/240pt are ordinary tolerance solutions.
#[test]
fn paragraph_breaks_match_pdftex_across_measures() {
for width in [100u32, 120, 150, 180, 200, 240] {
for width in [90u32, 100, 110, 120, 130, 150, 160, 180, 200, 220, 240] {
compare_fixture(WORDS, width);
}
}
/// `\emergencystretch` gives the final pass extra stretch, so TeX can avoid
/// an overfull line and break the paragraph into more lines.
#[test]
fn emergencystretch_matches_pdftex() {
compare_fixture_with(WORDS, 150, "\\emergencystretch=10pt ", |style| {
style.emergencystretch = 10 * 65_536;
});
}
/// `\leftskip` narrows the measure and shifts every line, so line starts and
/// breaks must match pdfLaTeX.
#[test]
fn leftskip_matches_pdftex() {
compare_fixture_with(WORDS, 150, "\\leftskip=20pt ", |style| {
style.left_skip = 20 * 65_536;
});
}