From 3676ed84d40fde69e58f8160e1a4a8f9d266e775 Mon Sep 17 00:00:00 2001 From: Gregory Date: Sat, 24 Apr 2021 22:36:49 -0400 Subject: [PATCH] Update desktop entry test case with mime types --- src/common/desktop_entry.rs | 6 ++++-- tests/cmus.desktop | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/desktop_entry.rs b/src/common/desktop_entry.rs index 21c765d..ce80cb9 100644 --- a/src/common/desktop_entry.rs +++ b/src/common/desktop_entry.rs @@ -148,7 +148,9 @@ mod tests { #[test] fn complex_exec() { - let path = PathBuf::from("tests/cmus.desktop"); - parse_file(&*path).unwrap(); + let entry = parse_file(Path::new("tests/cmus.desktop")).unwrap(); + assert_eq!(entry.mimes.len(), 2); + assert_eq!(entry.mimes[0].essence_str(), "audio/mp3"); + assert_eq!(entry.mimes[1].essence_str(), "audio/ogg"); } } diff --git a/tests/cmus.desktop b/tests/cmus.desktop index 16a324f..a26121d 100644 --- a/tests/cmus.desktop +++ b/tests/cmus.desktop @@ -9,3 +9,4 @@ Name=cmus-remote Comment=Music player cmus-remote control NoDisplay=true Icon=cmus +MimeType=audio/mp3;audio/ogg;