From 21dc64ea5f4011319a1c6bf9140108771e29edf7 Mon Sep 17 00:00:00 2001 From: Nick Nyssen <314538108+amoisttowe1@users.noreply.github.com> Date: Mon, 19 Oct 2026 22:13:38 -0700 Subject: [PATCH] M14: skip the loader tests when installed faces are switched off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `a_script_fallback_is_the_first_candidate_with_the_probe` calls script_fallback, which returns nothing when PDFCRAFT_SYSTEM_FONTS=0 โ€” the switch cargo xtask screenshots sets (AGENTS.md ยง1.4) โ€” so it failed in that mode on main, independently of the Devanagari fix. Skip both loader tests with a printed reason instead, matching crates/ui-egui/tests/fonts.rs. Split out from the previous commit so it can be dropped without touching the fix: PDFCRAFT_SYSTEM_FONTS=0 cargo test -p pdfcraft-ui-egui --lib system_fonts now reports 12 passed rather than one failure. --- crates/ui-egui/src/system_fonts.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ui-egui/src/system_fonts.rs b/crates/ui-egui/src/system_fonts.rs index 5eb6f80bed..360eec9de9 100644 --- a/crates/ui-egui/src/system_fonts.rs +++ b/crates/ui-egui/src/system_fonts.rs @@ -458,6 +458,12 @@ mod tests { #[test] fn a_script_fallback_is_the_first_candidate_with_the_probe() { + // This one calls `script_fallback` too, so it fails under the documented switch that + // published screenshots use โ€” skip with a reason, as tests/fonts.rs does. + if installed_faces_switched_off() { + eprintln!("skipping: PDFCRAFT_SYSTEM_FONTS=0 turns the loader off"); + return; + } let inter = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/fonts/Inter-Regular.ttf")); let candidates = [PathBuf::from("definitely/not/here.ttf"), inter]; assert!(script_fallback(&candidates, 'A').is_some());