Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Tests: postscript_only_style waits for the font scan

Ivanb23a01aa8fc9
diff --git a/crates/ui-egui/src/type_tool_tests.rs b/crates/ui-egui/src/type_tool_tests.rs
index 0f5be9e2f..5f7ae0c54 100644
--- a/crates/ui-egui/src/type_tool_tests.rs
+++ b/crates/ui-egui/src/type_tool_tests.rs
@@ -1271,6 +1271,9 @@ fn font_styles_keep_metadata_names_and_numeric_labels() {
#[test]
fn postscript_only_style_shows_actual_subfamily() {
+ // selected_style reads the engine only once the font scan is done (try_shared); on its own,
+ // as nextest runs it, nothing else has finished the scan, so wait for it here.
+ let _ = photocraft_text::shared();
let style = photocraft_doc::text::CharStyle { font_family: "Inter".into(), postscript_name: Some("Inter-SemiBold".into()), ..Default::default() };
assert_eq!(super::selected_style(&style), "SemiBold");
}