summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_html5lib.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/test_html5lib.rs b/tests/test_html5lib.rs
index 36f371a..a29cdc4 100644
--- a/tests/test_html5lib.rs
+++ b/tests/test_html5lib.rs
@@ -1,4 +1,4 @@
-use html5gum::{Doctype, EndTag, Error, Reader, StartTag, State, StringReader, Token, Tokenizer};
+use html5gum::{Doctype, EndTag, Error, Reader, StartTag, State, Token, Tokenizer};
use pretty_assertions::assert_eq;
use serde::{de::Error as _, Deserialize};
use std::{collections::BTreeMap, fs::File, io::BufReader, path::Path};
@@ -230,9 +230,18 @@ fn run_test(fname: &str, test_i: usize, mut test: Test) {
test_i,
&test,
state.0,
- Tokenizer::<StringReader>::new(&test.input),
+ Tokenizer::new(&test.input),
"string",
);
+
+ run_test_inner(
+ fname,
+ test_i,
+ &test,
+ state.0,
+ Tokenizer::new(BufReader::new(test.input.as_bytes())),
+ "bufread",
+ );
}
}
@@ -256,6 +265,8 @@ fn run_test_inner<R: Reader>(
let mut actual_errors = Vec::new();
for token in tokenizer {
+ let token = token.unwrap();
+
if let Token::Error(e) = token {
actual_errors.push(ParseError {
code: ParseErrorInner(e),