File: content_type.rs

package info (click to toggle)
rust-gio 0.21.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,744 kB
  • sloc: xml: 11; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 621 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Take a look at the license at the top of the repository in the LICENSE file.

#[cfg(unix)]
#[test]
fn test_content_type_guess() {
    // We only test for directory and file without extension here as we can't guarantee the
    // CI runners will have any mimetypes installed.
    let ret: (glib::GString, bool) =
        gio::functions::content_type_guess(Some(std::path::Path::new("test/")), None);
    assert_eq!(ret.0, "inode/directory");

    let ret: (glib::GString, bool) =
        gio::functions::content_type_guess(Some(std::path::Path::new("test")), None);
    assert_eq!(ret.0, "application/octet-stream");
}