aboutsummaryrefslogtreecommitdiff
path: root/integration_tests/tests
diff options
context:
space:
mode:
Diffstat (limited to 'integration_tests/tests')
-rw-r--r--integration_tests/tests/test_html5lib.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/integration_tests/tests/test_html5lib.rs b/integration_tests/tests/test_html5lib.rs
index fd69524..f351f85 100644
--- a/integration_tests/tests/test_html5lib.rs
+++ b/integration_tests/tests/test_html5lib.rs
@@ -4,7 +4,8 @@ use html5lib_tests::{
parse_tests, Error as TestError, InitialState, Output, Test, Token as TestToken,
};
use html5tokenizer::{
- offset::NoopOffset, reader::Reader, DefaultEmitter, InternalState, Token, Tokenizer,
+ offset::NoopOffset, reader::Reader, CdataAction, DefaultEmitter, Event, InternalState, Token,
+ Tokenizer,
};
use similar_asserts::assert_eq;
@@ -119,8 +120,14 @@ fn run_test_inner<R: Reader>(
tokens: Vec::new(),
};
- for token in tokenizer {
- let token = token.unwrap();
+ while let Some(event) = tokenizer.next() {
+ let token = match event.unwrap() {
+ Event::CdataOpen => {
+ tokenizer.handle_cdata_open(CdataAction::BogusComment);
+ continue;
+ }
+ Event::Token(token) => token,
+ };
match token {
Token::Error { error, .. } => actual.errors.push(TestError {