Pin the suite run, gate the exception list, and trim the corpus README
This commit is contained in:
+3
-6
@@ -12,12 +12,9 @@ One directory per contract kind, each landing with its milestone:
|
|||||||
pins which error.
|
pins which error.
|
||||||
- `real-payloads/` — `<name>.json`: sanitized live ADF, round-tripped ADF→markdown→ADF. No
|
- `real-payloads/` — `<name>.json`: sanitized live ADF, round-tripped ADF→markdown→ADF. No
|
||||||
expected markdown.
|
expected markdown.
|
||||||
- `commonmark-spec/` — `spec.json` (the pinned CommonMark suite, read as corpus data per
|
- `commonmark-spec/` — `spec.json` (the CommonMark 0.31.2 suite, vendored byte-exact) and
|
||||||
AGENTS.md §1) and `exceptions.json` (examples a documented divergence exempts, keyed by
|
`exceptions.json` (the examples a known divergence exempts, keyed by `check` and `example` with
|
||||||
`check` and `example` with a `reason`). Three checks an example must pass: the §2 canonical
|
a `reason`).
|
||||||
fixpoint — a named error, or markdown that parses and emits back to itself; the reference HTML's
|
|
||||||
text, tags stripped and entities decoded, against the parsed document's concatenated text; and a
|
|
||||||
count of the CommonMark subset's elements against the nodes and marks they map to.
|
|
||||||
|
|
||||||
JSON is editor-normal (AGENTS.md §2), two-space indent, keys sorted. `spec.json` is the vendored,
|
JSON is editor-normal (AGENTS.md §2), two-space indent, keys sorted. `spec.json` is the vendored,
|
||||||
upstream machine-readable suite (CommonMark 0.31.2, CC-BY-SA-4.0, © John MacFarlane) and is not
|
upstream machine-readable suite (CommonMark 0.31.2, CC-BY-SA-4.0, © John MacFarlane) and is not
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ const spec = readSpec()
|
|||||||
const exceptions = readExceptions()
|
const exceptions = readExceptions()
|
||||||
const exceptionIndex = new Map(exceptions.map((entry) => [`${entry.example}:${entry.check}`, entry.reason]))
|
const exceptionIndex = new Map(exceptions.map((entry) => [`${entry.example}:${entry.check}`, entry.reason]))
|
||||||
|
|
||||||
test('the CommonMark spec suite is the version the parser names', () => {
|
test('the CommonMark spec suite is the pinned 0.31.2 run', () => {
|
||||||
assert.ok(spec.length > 600, `spec.json holds ${spec.length} examples, not a full suite`)
|
assert.equal(spec.length, 652)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('the exception list is unique per example and check', () => {
|
test('the exception list is unique per example and check', () => {
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ function pairedNames(root: string, first: string, second: string): string[] {
|
|||||||
function corpusJsonPaths(): string[] {
|
function corpusJsonPaths(): string[] {
|
||||||
return readdirSync(corpusRoot, { encoding: 'utf8', recursive: true })
|
return readdirSync(corpusRoot, { encoding: 'utf8', recursive: true })
|
||||||
.filter((name) => name.endsWith('.json'))
|
.filter((name) => name.endsWith('.json'))
|
||||||
.filter((name) => !name.startsWith(`commonmark-spec${sep}`))
|
.filter((name) => name !== `commonmark-spec${sep}spec.json`)
|
||||||
.map((name) => join(corpusRoot, name))
|
.map((name) => join(corpusRoot, name))
|
||||||
.sort()
|
.sort()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user