Compliance cases
These are the 6,835 inputs a submission must decode. Each output must match the expected text byte for byte. You can run the suite without reading it, or open any case to see its input and expected output.
Run the full compliance suite locally. Replace your-component.wasm
with your compiled component.
Download the suite
curl -fLo unescape_html.comply.wasm https://calculated.world/comply/unescape_html.wasm
qipx comply your-component.wasm --with unescape_html.comply.wasm
15 of 6,835 cases
| Case | Name | Expected | Note | Size |
|---|---|---|---|---|
| 004620 | ampersand-lone Focused regression |
&
|
1 B | |
| 004621 | ampersand-double Focused regression |
&&
|
2 B | |
| 004622 | ampersand-space Focused regression |
&
|
2 B | |
| 004623 | ampersand-between-words Focused regression |
a & b
|
5 B | |
| 004624 | ampersand-before-amp Focused regression |
&&
|
6 B | |
| 004625 | ampersand-trailing Focused regression |
x&
|
2 B | |
| 004626 | numeric-no-digits-2623 Focused regression |
&#
|
2 B | |
| 004627 | numeric-no-digits-26233b Focused regression |
&#;
|
3 B | |
| 004628 | numeric-no-digits-262378 Focused regression |
&#x
|
3 B | |
| 004629 | numeric-no-digits-262358 Focused regression |
&#X
|
3 B | |
| 004630 | numeric-no-digits-2623783b Focused regression |
&#x;
|
4 B | |
| 004631 | numeric-no-digits-262378673b Focused regression |
&#xg;
|
5 B | |
| 004632 | numeric-no-digits-26232d313b Focused regression |
&#-1;
|
5 B | |
| 004633 | numeric-no-digits-26232036353b Focused regression |
&# 65;
|
6 B | |
| 004634 | numeric-no-digits-26232b36353b Focused regression |
&#+65;
|
6 B |
Where these rules come from
Expected outputs come from Python’s html.unescape, changed to keep references to controls and noncharacters the way the WHATWG tokenizer does.
- Named character references — the table of 2,231 names, including the legacy ones that work without a semicolon
- Numeric character reference end state — the Windows-1252 remapping and the rules for 0, surrogates and out-of-range numbers
- html5lib-tests tokenizer tests — the source of the 4,617 html5lib cases