mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-02 16:30:36 -06:00
#1597: make validation independent of installed fonts and dictionaries
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user