MimeType - fix tests

This commit is contained in:
Gregory 2021-04-29 20:51:36 -04:00
parent 44efa593f8
commit 602b2dd153
No known key found for this signature in database
GPG key ID: 2E44FAEEDC94B1E2

View file

@ -92,14 +92,20 @@ mod tests {
#[test]
fn from_path() -> Result<()> {
assert_eq!(MimeType::try_from(".")?.0.essence_str(), "inode/directory");
assert_eq!(MimeType::try_from("./tests/rust.vim")?.0, "text/plain");
assert_eq!(
MimeType::try_from("./tests/cat")?.0,
MimeType::try_from(Path::new("."))?.0.essence_str(),
"inode/directory"
);
assert_eq!(
MimeType::try_from(Path::new("./tests/rust.vim"))?.0,
"text/plain"
);
assert_eq!(
MimeType::try_from(Path::new("./tests/cat"))?.0,
"application/x-shellscript"
);
assert_eq!(
MimeType::try_from("./tests/SettingsWidgetFdoSecrets.ui")?.0,
MimeType::try_from(Path::new("./tests/SettingsWidgetFdoSecrets.ui"))?.0,
"application/x-designer"
);