Skip to content

Commit 439aeef

Browse files
authored
test: Add upstream html5lib-tests (#447)
1 parent 97d32e1 commit 439aeef

File tree

8 files changed

+12
-13
lines changed

8 files changed

+12
-13
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
test/data/html5lib-tests
2+
test/data/html5lib-tests-fork
23
packages/*/dist/
34
test/dist/
45
node_modules

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[submodule "html5lib-tests-fork"]
2+
path = test/data/html5lib-tests-fork
3+
url = https://github.com/HTMLParseErrorWG/html5lib-tests
14
[submodule "html5lib-tests"]
25
path = test/data/html5lib-tests
3-
url = https://github.com/HTMLParseErrorWG/html5lib-tests
6+
url = https://github.com/html5lib/html5lib-tests.git

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
packages/*/dist/
22
test/dist/
33
docs
4-
test/data/html5lib-tests
4+
test/data/html5lib-tests
5+
test/data/html5lib-tests-fork

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"lint:prettier": "npm run prettier -- --check",
3939
"unit-tests": "NODE_OPTIONS=--experimental-vm-modules jest",
4040
"test": "npm run lint && npm run unit-tests",
41-
"generate-feedback-tests": "node --loader ts-node/esm scripts/generate-parser-feedback-test/index.ts test/data/html5lib-tests/tree-construction/*.dat test/data/tree-construction-regression/*.dat",
41+
"generate-feedback-tests": "node --loader ts-node/esm scripts/generate-parser-feedback-test/index.ts test/data/html5lib-tests/tree-construction/*.dat",
4242
"bench-perf": "npm run build && node bench/perf/index.js",
4343
"bench-memory-sax": "npm run build && node bench/memory/sax-parser.js",
4444
"preversion": "npm test",
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as parse5 from 'parse5';
21
import { Tokenizer } from 'parse5/dist/tokenizer/index.js';
32
import { generateTokenizationTests } from 'parse5-test-utils/utils/generate-tokenization-tests.js';
43

@@ -8,10 +7,3 @@ const tokenizerOpts = {
87
};
98

109
generateTokenizationTests('Tokenizer', dataPath.pathname, (handler) => new Tokenizer(tokenizerOpts, handler));
11-
12-
describe('tokenizer', () => {
13-
it('Regression - `<<` in comment parses correctly (GH-325)', () => {
14-
const document = parse5.parse('<!--<<-->');
15-
expect(document.childNodes[0]).toHaveProperty('data', '<<');
16-
});
17-
});

test/data/html5lib-tests

Submodule html5lib-tests updated 56 files

test/data/html5lib-tests-fork

Submodule html5lib-tests-fork added at 11c3216

test/utils/generate-parsing-tests.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ function createParsingTest<T extends TreeAdapterTypeMap>(
118118
};
119119
}
120120

121-
const treePath = new URL('../data/html5lib-tests/tree-construction', import.meta.url);
121+
// TODO: Stop using the fork here.
122+
const treePath = new URL('../data/html5lib-tests-fork/tree-construction', import.meta.url);
122123
const treeRegressionPath = new URL('../data/tree-construction-regression', import.meta.url);
123124

124125
export function generateParsingTests(

0 commit comments

Comments
 (0)