mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
MIMEClassifier::classify always succeeds; fix the type to reflect this.
This commit is contained in:
parent
9fca41c7a7
commit
1c4962288c
3 changed files with 26 additions and 29 deletions
|
@ -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 {}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue