]> git.seodisparate.com - mpd_info_screen/commitdiff
Fix emitted warning, minor change to unit test
authorStephen Seo <seo.disparate@gmail.com>
Wed, 19 Mar 2025 10:54:38 +0000 (19:54 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 19 Mar 2025 10:54:38 +0000 (19:54 +0900)
src/unicode_support.rs

index f3d6de0a194c4e78b1ad37407a36e799968a1b0a..0d1ed0a29d89adfac62c22c02204d63a5cf57358 100644 (file)
@@ -2,6 +2,7 @@ mod fontconfig;
 mod freetype;
 
 pub use self::freetype::font_has_char;
+#[allow(unused_imports)]
 pub use fontconfig::{get_matching_font_from_char, get_matching_font_from_str};
 
 #[cfg(test)]
@@ -15,5 +16,16 @@ mod tests {
         if !font_has_char('a', &fetched_path).expect("Should be able to check font for 'a'") {
             panic!("fetched font does not have 'a'");
         }
+        let fetched_path =
+            get_matching_font_from_str("text").expect("Should be able to find match for 'text'");
+        if !font_has_char('t', &fetched_path).expect("Shouuld be able to check font for 't'") {
+            panic!("fetched font does not have 't'");
+        }
+        if !font_has_char('e', &fetched_path).expect("Shouuld be able to check font for 'e'") {
+            panic!("fetched font does not have 'e'");
+        }
+        if !font_has_char('x', &fetched_path).expect("Shouuld be able to check font for 'x'") {
+            panic!("fetched font does not have 'x'");
+        }
     }
 }