aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html5lib_tests/src/lib.rs36
1 files changed, 15 insertions, 21 deletions
diff --git a/html5lib_tests/src/lib.rs b/html5lib_tests/src/lib.rs
index 5678b0d..c007317 100644
--- a/html5lib_tests/src/lib.rs
+++ b/html5lib_tests/src/lib.rs
@@ -188,27 +188,21 @@ struct Tests {
}
fn undo_double_escaping(mut test: Test) -> Test {
- test.input = if test.double_escaped {
- unescape(&test.input)
- } else {
- test.input
- };
-
- test.output = if test.double_escaped {
- ExpectedOutputTokens(
- test.output
- .0
- .into_iter()
- .map(|token| match token {
- Token::String(x) => Token::String(unescape(&x)),
- Token::Comment(x) => Token::Comment(unescape(&x)),
- token => token,
- })
- .collect(),
- )
- } else {
- ExpectedOutputTokens(test.output.0)
- };
+ if test.double_escaped {
+ test.input = unescape(&test.input);
+
+ test.output.0 = test
+ .output
+ .0
+ .into_iter()
+ .map(|token| match token {
+ Token::String(x) => Token::String(unescape(&x)),
+ Token::Comment(x) => Token::Comment(unescape(&x)),
+ token => token,
+ })
+ .collect();
+ }
+
test
}