tree_magic
tree_magic copied to clipboard
from_filepath and match_filepath seem to disagree for "text/html"
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.