mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-31 13:37:35 -06:00
M14: skip the loader tests when installed faces are switched off
`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.
This commit is contained in:
@@ -458,6 +458,12 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_script_fallback_is_the_first_candidate_with_the_probe() {
|
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 inter = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/fonts/Inter-Regular.ttf"));
|
||||||
let candidates = [PathBuf::from("definitely/not/here.ttf"), inter];
|
let candidates = [PathBuf::from("definitely/not/here.ttf"), inter];
|
||||||
assert!(script_fallback(&candidates, 'A').is_some());
|
assert!(script_fallback(&candidates, 'A').is_some());
|
||||||
|
|||||||
Reference in New Issue
Block a user