From 82418896f0dcf9409eaff4e75406a8a019b89a34 Mon Sep 17 00:00:00 2001 From: Martin Ball Date: Sun, 1 Nov 2026 19:20:17 +0000 Subject: [PATCH] CP4.3: layout test checks Polish hyphenation only when the Polish patterns are embedded (a Language build); otherwise they come from the pack Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FypgCX8LsYYE8fsj4byBm2 --- crates/layout/src/tests.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/layout/src/tests.rs b/crates/layout/src/tests.rs index 5caf63784..52eda56e6 100644 --- a/crates/layout/src/tests.rs +++ b/crates/layout/src/tests.rs @@ -8279,8 +8279,12 @@ fn hyphenation_and_proofing_follow_each_runs_language() { let para = l.pages[0].items.iter().find_map(|i| if let Placed::Lines { para, .. } = i { Some(para.clone()) } else { None }).expect("a paragraph"); // Byte offsets after which a hyphen may go. let ends: Vec = para.hyph_after.iter().filter_map(|&k| para.clusters.get(k as usize).map(|c| c.end)).collect(); - for prefix in ["Kon", "Konsty", "Konstytu", "Konstytucyj", "Konstytucyjne"] { - assert!(ends.contains(&prefix.len()), "Polish kon-sty-tu-cyj-ne-go: no break after {prefix:?} in {ends:?}"); + // Polish patterns are embedded only in a Language build (`CRAFT_PROOF_EMBED`); otherwise + // they come from the Polish Language pack. + if wordcraft_proof::packs::embedded_locales().contains(&"pl") { + for prefix in ["Kon", "Konsty", "Konstytu", "Konstytucyj", "Konstytucyjne"] { + assert!(ends.contains(&prefix.len()), "Polish kon-sty-tu-cyj-ne-go: no break after {prefix:?} in {ends:?}"); + } } for prefix in ["ty", "typog", "typogra"] { assert!(ends.contains(&(eng + prefix.len())), "English ty-pog-ra-phy: no break after {prefix:?} in {ends:?}");