You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test coverage today is hand-written unit tests (in src/tree_builder.rs, src/tokenizer.rs) and end-to-end tests (src/lib.rs) targeting specific spec sections and scenarios ported from html-conform's own test matrix. That's solid for verifying individual algorithms, but there's no automated check against the html5lib-tests / WHATWG shared conformance corpus that every serious HTML5 parser (html5ever, html.parser, Validator.nu, browsers) is measured against. For a from-scratch, spec-transcribed parser, this is the single most valuable remaining quality signal — it would catch transcription mistakes and edge cases no amount of hand-written tests will reliably find.
Solution path
Vendor (or fetch via an xtask script, matching the existing xtask/gen-entities.py pattern) the tree-construction/*.dat files from https://github.com/html5lib/html5lib-tests — a well-known, widely-used format:
#data — input HTML.
#errors — expected parse errors (not applicable here, this crate has no diagnostics; skip this section).
#document — expected resulting tree, as an indented text dump.
Some files also have #document-fragment (fragment-parsing cases) and #script-off/#script-on — since this crate has no fragment parsing and always treats scripting as disabled, only the plain #document full-document cases apply. Document which sections/files are skipped and why (matching this project's existing "no silent exclusions" practice).
Write a small parser for the .dat format (it's simple — blank-line-separated sections) and a serializer that converts this crate's Document tree into the same indentation-based dump format html5lib-tests uses, so expected vs. actual can be compared as plain strings.
Add this as an integration test (e.g. tests/html5lib_conformance.rs) that runs each case through parse() and diffs the dump. Start with the simpler files (tests1.dat, tests2.dat) before the harder ones (tables01.dat, adoption01.dat; skip foreign-fragment.dat, it's fragment-only).
Problem
Test coverage today is hand-written unit tests (in
src/tree_builder.rs,src/tokenizer.rs) and end-to-end tests (src/lib.rs) targeting specific spec sections and scenarios ported from html-conform's own test matrix. That's solid for verifying individual algorithms, but there's no automated check against the html5lib-tests / WHATWG shared conformance corpus that every serious HTML5 parser (html5ever, html.parser, Validator.nu, browsers) is measured against. For a from-scratch, spec-transcribed parser, this is the single most valuable remaining quality signal — it would catch transcription mistakes and edge cases no amount of hand-written tests will reliably find.Solution path
xtask/gen-entities.pypattern) thetree-construction/*.datfiles from https://github.com/html5lib/html5lib-tests — a well-known, widely-used format:#data— input HTML.#errors— expected parse errors (not applicable here, this crate has no diagnostics; skip this section).#document— expected resulting tree, as an indented text dump.#document-fragment(fragment-parsing cases) and#script-off/#script-on— since this crate has no fragment parsing and always treats scripting as disabled, only the plain#documentfull-document cases apply. Document which sections/files are skipped and why (matching this project's existing "no silent exclusions" practice)..datformat (it's simple — blank-line-separated sections) and a serializer that converts this crate'sDocumenttree into the same indentation-based dump format html5lib-tests uses, so expected vs. actual can be compared as plain strings.tests/html5lib_conformance.rs) that runs each case throughparse()and diffs the dump. Start with the simpler files (tests1.dat,tests2.dat) before the harder ones (tables01.dat,adoption01.dat; skipforeign-fragment.dat, it's fragment-only).# known-failingallowlist, or#[ignore]with a documented reason) a nonzero number of failures at first, from the frameset/template gaps (see README overstates tree-construction completeness (frameset modes, <template> simplification undocumented) html5-parser#1) and any real transcription bugs the corpus surfaces. Fix what's fixable, document what's out of scope..github/workflows/ci.yml) once the pass rate is stable, so future regressions get caught automatically.This is a substantial task — plan to work through it in stages (vendor + harness first, then work through failures file by file), not as a single PR.