Spell the check set once; fix the doubled spec version and a stale filename
CI / gate (push) Successful in 18s
CI / publish (push) Has been skipped

This commit is contained in:
2026-09-09 15:40:29 +02:00
parent d1331a6612
commit f81bebe8d0
3 changed files with 12 additions and 11 deletions
+4 -3
View File
@@ -10,8 +10,9 @@ import { adfToMarkdown } from './markdown/emit/adf-to-markdown.ts'
import { markdownToAdf } from './markdown/parse/markdown-to-adf.ts'
const root = join(dirname(fileURLToPath(import.meta.url)), '..', 'corpus', 'commonmark-spec')
const checks = ['count', 'fixpoint', 'text'] as const
type Check = 'count' | 'fixpoint' | 'text'
type Check = (typeof checks)[number]
type ExceptionKind = 'mark-model' | 'pending' | 'unspellable'
type SpecExample = { example: number; html: string; markdown: string; section: string }
@@ -25,7 +26,7 @@ function isRecord(value: unknown): value is Record<string, unknown> {
}
function isCheck(value: unknown): value is Check {
return value === 'count' || value === 'fixpoint' || value === 'text'
return checks.some((check) => check === value)
}
function isKind(value: unknown): value is ExceptionKind {
@@ -325,7 +326,7 @@ for (const example of spec) {
fixpoint: fixpointRefused(example, parse.value),
text: textMismatch(example, parse.value),
}
for (const check of ['count', 'fixpoint', 'text'] as const) {
for (const check of checks) {
const entry = exceptionIndex.get(`${example.example}:${check}`)
const divergence = divergences[check]
if (divergence === undefined) {