Skip to content

Commit

Permalink
fix parsing bug in treebuilder testsuite, add crash
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Oct 29, 2024
1 parent 90c108c commit b399f31
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/custom-html5lib-tests/tree-construction/custom.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#data
<script></code><a href=foo></a></script>
#errors
#document
| <!DOCTYPE html>
| <html>
| <head>
| <script>
| "</code><a href=foo></a>"
| <body>
#errors
2 changes: 1 addition & 1 deletion tests/html5lib_tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ fn main() {
produce_testcases_from_file(&mut tests, &entry.unwrap());
}

for entry in glob("tests/custom-html5lib-tests/*.test").unwrap() {
for entry in glob("tests/custom-html5lib-tests/tokenizer/*.test").unwrap() {
produce_testcases_from_file(&mut tests, &entry.unwrap());
}

Expand Down
10 changes: 9 additions & 1 deletion tests/html5lib_tree_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ impl Testcase {
}
}

None
if has_errors {
Some(rv)
} else {
None
}
}
}

Expand Down Expand Up @@ -290,6 +294,10 @@ fn main() {
let args = Arguments::from_args();
let mut tests = Vec::new();

for entry in glob("tests/custom-html5lib-tests/tree-construction/*.dat").unwrap() {
produce_testcases_from_file(&mut tests, &entry.unwrap());
}

for entry in glob("tests/html5lib-tests/tree-construction/*.dat").unwrap() {
produce_testcases_from_file(&mut tests, &entry.unwrap());
}
Expand Down

0 comments on commit b399f31

Please sign in to comment.