From aff500202cd8026788528247ad25a1cfa95bf27d Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 9 Mar 2022 10:58:52 -0500 Subject: [PATCH] add FileData test --- src/egui_app.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/egui_app.rs b/src/egui_app.rs index 59942b4..42ccb88 100644 --- a/src/egui_app.rs +++ b/src/egui_app.rs @@ -183,6 +183,21 @@ lazy_static::lazy_static! { }; } + +// Tests to make sure archived (and compressed) assets match expected data +#[test] +fn test_file_data() { + assert_eq!(FILE_DATA.font_ubuntu_light, FontData::from_owned(include_bytes!("../assets/Ubuntu-Light.ttf").to_vec())); + assert_eq!(FILE_DATA.font_notoemoji, FontData::from_owned(include_bytes!("../assets/NotoEmoji-Regular.ttf").to_vec())); + assert_eq!(FILE_DATA.font_hack, FontData::from_owned(include_bytes!("../assets/Hack-Regular.ttf").to_vec())); + + assert_eq!(FILE_DATA.text_help_expr, include_str!("../assets/text_help_expr.txt")); + assert_eq!(FILE_DATA.text_help_vars, include_str!("../assets/text_help_vars.txt")); + assert_eq!(FILE_DATA.text_help_panel, include_str!("../assets/text_help_panel.txt")); + assert_eq!(FILE_DATA.text_help_function, include_str!("../assets/text_help_function.txt")); + assert_eq!(FILE_DATA.text_help_other, include_str!("../assets/text_help_other.txt")); +} + cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { use wasm_bindgen::JsCast;