Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

from_filepath and match_filepath seem to disagree for "text/html" #4

Open
commonquail opened this issue May 21, 2017 · 0 comments
Open

Comments

@commonquail
Copy link

Cargo.toml:

[package]
name = "blah"
version = "0.1.0"

[dependencies]
tree_magic="0.2.0"

index.html:

<!DOCTYPE html>

src/lib.rs:

extern crate tree_magic;

#[cfg(test)]
mod tests {

    use super::*;
    use std::path::Path;

    static MIME: &str = "text/html";
    static FILE: &str = "index.html";

    #[test]
    fn from_filepath() {
        assert_eq!(MIME, tree_magic::from_filepath(Path::new(FILE)));
    }

    #[test]
    fn match_filepath() {
        assert!(tree_magic::match_filepath(MIME, Path::new(FILE)));
    }
}

Running cargo test on the above project shows ´from_filepathpassing andmatch_filepathfailing.from_filepath` seems to pass as long as the HTML file has DOCTYPE html, ignoring everything else.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant