#1597: make validation independent of installed fonts and dictionaries

This commit is contained in:
scks1
2026-11-01 08:58:13 -05:00
parent a3fbf02952
commit 650c4f9497
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -202,7 +202,10 @@ fn unsafe_url_links_are_not_exported() {
/// memory. Its naming/shaping tables still parse, but its missing head table prevents PDF
/// embedding. No font bytes or vendor assets are stored as test fixtures.
fn font_without_head() -> Vec<u8> {
let mut bytes = FontDb::global().face("Ubuntu", "Regular").data().to_vec();
// An installed variable Ubuntu can expose many faces; use the bundled static
// Light face so the damaged fixture always adds exactly one face.
let bundled = FontDb::with_font_dirs(Vec::new());
let mut bytes = bundled.face("Ubuntu", "Light").data().to_vec();
for (old, new) in [(b"Ubuntu".as_slice(), b"BadPDF".as_slice()), (b"\0U\0b\0u\0n\0t\0u".as_slice(), b"\0B\0a\0d\0P\0D\0F".as_slice())] {
let mut offset = 0;
while offset + old.len() <= bytes.len() {
+2 -1
View File
@@ -999,7 +999,8 @@ fn the_language_dialog_marks_the_selected_text() {
harness.state_mut().run("app.dialog", json!({"id": "language"})).unwrap();
// The anchored window settles over its first frames; click once it stays put.
harness.run_steps(4);
harness.get_by_label("Français (France)").click();
// Installed dictionaries append a marker to the language's accessible label.
harness.get_by_label_contains("Français (France)").click();
harness.run_steps(2);
harness.get_by_label("OK").click();
harness.run_steps(2);