merge: epoch-1.9.0 d'upstream
# Conflicts: # Cargo.lock # src/menu.rs
This commit is contained in:
commit
4b5fcfe5d7
26 changed files with 1250 additions and 1132 deletions
|
|
@ -175,3 +175,25 @@ pub fn thumbnailer(mime: &Mime) -> Vec<Thumbnailer> {
|
|||
let thumbnailer_cache = THUMBNAILER_CACHE.lock().unwrap();
|
||||
thumbnailer_cache.get(mime)
|
||||
}
|
||||
|
||||
#[cfg(all(test, feature = "desktop"))]
|
||||
mod tests {
|
||||
use super::Thumbnailer;
|
||||
use std::path::Path;
|
||||
|
||||
#[test]
|
||||
fn command_expands_thumbnailer_arguments() {
|
||||
let thumbnailer = Thumbnailer {
|
||||
exec: "cosmic-files-thumbnailer %o --size %s %i".to_string(),
|
||||
};
|
||||
|
||||
let command = thumbnailer
|
||||
.command(Path::new("input.exe"), Path::new("output.png"), 128)
|
||||
.expect("valid thumbnailer command");
|
||||
assert_eq!(command.get_program(), "cosmic-files-thumbnailer");
|
||||
assert_eq!(
|
||||
command.get_args().collect::<Vec<_>>(),
|
||||
["output.png", "--size", "128", "input.exe"]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue