chore: remove linicon dev-dependency
This commit is contained in:
parent
7bb19f1b50
commit
7a61a704f6
3 changed files with 0 additions and 109 deletions
|
|
@ -20,7 +20,6 @@ xdg = "3.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
speculoos = "0.13.0"
|
speculoos = "0.13.0"
|
||||||
linicon = "2.3.0"
|
|
||||||
criterion = "0.7"
|
criterion = "0.7"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
||||||
|
|
@ -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"));
|
|
||||||
}
|
|
||||||
21
src/lib.rs
21
src/lib.rs
|
|
@ -571,27 +571,6 @@ mod test {
|
||||||
.is_equal_to(PathBuf::from("/usr/share/pixmaps/archlinux-logo.png"));
|
.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]
|
#[test]
|
||||||
fn should_not_attempt_to_lookup_a_not_found_cached_icon() {
|
fn should_not_attempt_to_lookup_a_not_found_cached_icon() {
|
||||||
let not_found = lookup("not-found").with_cache().find();
|
let not_found = lookup("not-found").with_cache().find();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue