mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #9631 - jongiddy:remove-extra-mask-byte, r=jdm
Validate MIME pattern checking The MIME detector for a HTML file contains an additional byte in the mask. While it doesn't hurt, it is not used in the byte matching code (since it is zipped with the `pattern` iterator). I'm not clear how to test this within the `servo` code. The fix doesn't change any externally visible behavior. A test to validate the `ByteMatcher` structures would require the private ByteMatcher structures to be visible to the test. I could use a sub-module, as described at https://doc.rust-lang.org/book/testing.html#the-tests-module but this pattern doesn't appear anywhere else in the `servo` code. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9631) <!-- Reviewable:end -->
This commit is contained in:
commit
32c97b6c8d
3 changed files with 75 additions and 6 deletions
|
@ -50,6 +50,12 @@ fn test_sniff_mp4_matcher_long() {
|
|||
assert!(matcher.matches(&data));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_validate_classifier() {
|
||||
let classifier = MIMEClassifier::new();
|
||||
classifier.validate().expect("Validation error")
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn test_sniff_with_flags(filename_orig: &path::Path,
|
||||
type_string: &str,
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 14 B After Width: | Height: | Size: 14 B |
Loading…
Add table
Add a link
Reference in a new issue