summaryrefslogtreecommitdiff
path: root/integration_tests/tests
diff options
context:
space:
mode:
Diffstat (limited to 'integration_tests/tests')
-rw-r--r--integration_tests/tests/test_html5lib.rs26
1 files changed, 15 insertions, 11 deletions
diff --git a/integration_tests/tests/test_html5lib.rs b/integration_tests/tests/test_html5lib.rs
index f13e580..0cf5868 100644
--- a/integration_tests/tests/test_html5lib.rs
+++ b/integration_tests/tests/test_html5lib.rs
@@ -115,10 +115,8 @@ fn run_test_inner<R: Reader>(
tokenizer.set_last_start_tag(last_start_tag);
}
- let mut actual = Output {
- errors: Vec::new(),
- tokens: Vec::new(),
- };
+ let mut actual_errors = Vec::new();
+ let mut actual_tokens = Vec::new();
while let Some(event) = tokenizer.next() {
let token = match event.unwrap() {
@@ -130,10 +128,10 @@ fn run_test_inner<R: Reader>(
};
match token {
- Token::Error { error, .. } => actual.errors.push(TestError {
+ Token::Error { error, .. } => actual_errors.push(TestError {
code: error.code().to_string(),
}),
- Token::StartTag(tag) => actual.tokens.push(TestToken::StartTag {
+ Token::StartTag(tag) => actual_tokens.push(TestToken::StartTag {
name: tag.name,
attributes: tag
.attributes
@@ -142,10 +140,10 @@ fn run_test_inner<R: Reader>(
.collect(),
self_closing: tag.self_closing,
}),
- Token::EndTag(tag) => actual.tokens.push(TestToken::EndTag { name: tag.name }),
- Token::String(data) => actual.tokens.push(TestToken::Character(data)),
- Token::Comment(comment) => actual.tokens.push(TestToken::Comment(comment.data)),
- Token::Doctype(doctype) => actual.tokens.push(TestToken::Doctype {
+ Token::EndTag(tag) => actual_tokens.push(TestToken::EndTag { name: tag.name }),
+ Token::String(data) => actual_tokens.push(TestToken::Character(data)),
+ Token::Comment(comment) => actual_tokens.push(TestToken::Comment(comment.data)),
+ Token::Doctype(doctype) => actual_tokens.push(TestToken::Doctype {
name: doctype.name,
public_id: doctype.public_id,
system_id: doctype.system_id,
@@ -154,5 +152,11 @@ fn run_test_inner<R: Reader>(
};
}
- assert_eq!(test.output, actual);
+ assert_eq!(
+ Output {
+ errors: actual_errors,
+ tokens: actual_tokens,
+ },
+ test.output,
+ );
}