Debian Codegraph @

debian/missing-sources/gio/tests/content_type.rs

raw
1 // Take a look at the license at the top of the repository in the LICENSE file.
2
3 #[cfg(unix)]
4 #[test]
5 fn test_content_type_guess() {
6 // We only test for directory and file without extension here as we can't guarantee the
7 // CI runners will have any mimetypes installed.
8 let ret: (glib::GString, bool) =
9 gio::functions::content_type_guess(Some(std::path::Path::new("test/")), None);
10 assert_eq!(ret.0, "inode/directory");
11
12 let ret: (glib::GString, bool) =
13 gio::functions::content_type_guess(Some(std::path::Path::new("test")), None);
14 assert_eq!(ret.0, "application/octet-stream");
15 }