Auto merge of #7967 - eefriedman:mime-handling, r=jdm

MIMEClassifier::classify always succeeds; fix the type to reflect this.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7967)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-10-14 08:46:32 -06:00
commit 7308d0dd0d
3 changed files with 26 additions and 29 deletions

View file

@ -55,17 +55,15 @@ fn test_sniff_with_flags(filename_orig: &path::Path,
match read_result {
Ok(data) => {
match classifier.classify(no_sniff_flag, apache_bug_flag, &as_string_option(supplied_type), &data) {
Some((parsed_type, parsed_subtp)) => {
if (&parsed_type[..] != type_string) ||
(&parsed_subtp[..] != subtype_string) {
panic!("File {:?} parsed incorrectly should be {}/{}, parsed as {}/{}",
filename, type_string, subtype_string,
parsed_type, parsed_subtp);
}
}
None => panic!("No classification found for {:?} with supplied type {:?}",
filename, supplied_type),
let (parsed_type, parsed_subtp) = classifier.classify(no_sniff_flag,
apache_bug_flag,
&as_string_option(supplied_type),
&data);
if (&parsed_type[..] != type_string) ||
(&parsed_subtp[..] != subtype_string) {
panic!("File {:?} parsed incorrectly should be {}/{}, parsed as {}/{}",
filename, type_string, subtype_string,
parsed_type, parsed_subtp);
}
}
Err(e) => panic!("Couldn't read from file {:?} with error {}",