From 7a61a704f6d1ec41f71cbe766e3cc484858523fa Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Tue, 2 Dec 2025 20:29:34 +0100 Subject: [PATCH] chore: remove linicon dev-dependency --- Cargo.toml | 1 - benches/tests.rs | 87 ------------------------------------------------ src/lib.rs | 21 ------------ 3 files changed, 109 deletions(-) delete mode 100644 benches/tests.rs diff --git a/Cargo.toml b/Cargo.toml index 907cf0c..298d939 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,6 @@ xdg = "3.0" [dev-dependencies] speculoos = "0.13.0" -linicon = "2.3.0" criterion = "0.7" [features] diff --git a/benches/tests.rs b/benches/tests.rs deleted file mode 100644 index 27a5e8a..0000000 --- a/benches/tests.rs +++ /dev/null @@ -1,87 +0,0 @@ -use cosmic_freedesktop_icons::lookup; -use speculoos::prelude::*; -use std::path::PathBuf; - -// Linicon sometimes fails with theme that have unknown parents -// This test only ensure we are running the correct function in the benchmarks -// And results are identical. -#[test] -fn linicon() { - // Current theme - let lin_user_home = linicon::lookup_icon("user-home") - .from_theme("Adwaita") - .with_size(24) - .with_scale(1) - .next(); - - let user_home = lookup("user-home") - .with_theme("Adwaita") - .with_size(24) - .with_scale(1) - .find(); - - asserting!("Linicon return some icon") - .that(&lin_user_home.unwrap()) - .is_ok() - .map(|icon| &icon.path) - .is_equal_to(PathBuf::from( - "/usr/share/icons/Adwaita/24x24/places/user-home.png", - )); - - asserting!("Our implementation should return the same result as linicon") - .that(&user_home) - .is_some() - .is_equal_to(PathBuf::from( - "/usr/share/icons/Adwaita/24x24/places/user-home.png", - )); - - // Fallback to hicolor - let lin_firefox = linicon::lookup_icon("firefox") - .from_theme("Adwaita") - .with_size(24) - .with_scale(1) - .next(); - - let firefox = lookup("firefox") - .with_theme("Adwaita") - .with_size(24) - .with_scale(1) - .find(); - - asserting!("Linicon return some icon") - .that(&lin_firefox.unwrap()) - .is_ok() - .map(|icon| &icon.path) - .is_equal_to(PathBuf::from( - "/usr/share/icons/hicolor/22x22/apps/firefox.png", - )); - - asserting!("Our implementation should return the same result as linicon") - .that(&firefox) - .is_some() - .is_equal_to(PathBuf::from( - "/usr/share/icons/hicolor/22x22/apps/firefox.png", - )); - - // pixmaps - let lin_archlinux = linicon::lookup_icon("archlinux-logo") - .from_theme("Adwaita") - .with_size(24) - .with_scale(1) - .next(); - - let archlinux = lookup("archlinux-logo") - .with_theme("Adwaita") - .with_size(24) - .with_scale(1) - .find(); - - asserting!("Linicon fails to fallback to pixmaps") - .that(&lin_archlinux) - .is_none(); - - asserting!("But we succeed") - .that(&archlinux) - .is_some() - .is_equal_to(PathBuf::from("/usr/share/pixmaps/archlinux-logo.png")); -} diff --git a/src/lib.rs b/src/lib.rs index fc9f803..82ea750 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -571,27 +571,6 @@ mod test { .is_equal_to(PathBuf::from("/usr/share/pixmaps/archlinux-logo.png")); } - #[test] - #[cfg(feature = "local_tests")] - fn compare_to_linincon_with_theme() { - let lin_wireshark = linicon::lookup_icon("wireshark") - .next() - .unwrap() - .unwrap() - .path; - - let wireshark = lookup("wireshark") - .with_size(16) - .with_scale(1) - .with_theme("Papirus") - .find(); - - asserting!("Given the same input parameter, lookup should output be the same as linincon") - .that(&wireshark) - .is_some() - .is_equal_to(lin_wireshark); - } - #[test] fn should_not_attempt_to_lookup_a_not_found_cached_icon() { let not_found = lookup("not-found").with_cache().find();