Skip to content

Commit

Permalink
fix bom configuration for html5ever fuzzing
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Jul 22, 2023
1 parent 7040105 commit bc4d108
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fuzz/src/testcase/html5ever.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use html5ever::buffer_queue::BufferQueue;
use html5ever::tendril::format_tendril;
use html5ever::tokenizer::{TagKind, Token as Token2, TokenSinkResult, TokenizerResult};
use html5ever::tokenizer::{TagKind, Token as Token2, TokenSinkResult, TokenizerResult, TokenizerOpts};
use html5gum::{Emitter, Reader, Token};

use pretty_assertions::assert_eq;
Expand All @@ -11,7 +11,13 @@ pub fn run_html5ever(s: &str) {
testing_tokenizer: html5gum::Tokenizer::new(s),
carried_over_token: None,
},
Default::default(),
TokenizerOpts {
// the html5gum tokenizer does not handle the BOM, and also not discarding a BOM is
// what the test suite expects, see https://github.com/html5lib/html5lib-tests/issues/2
discard_bom: false,

..Default::default()
},
);
let mut queue = BufferQueue::new();
queue.push_back(format_tendril!("{}", s));
Expand Down

0 comments on commit bc4d108

Please sign in to comment.