Write the same plain markdown for documents the editor holds equal: normalize the reduction's input again, naming a refusal by the caller's document

This commit is contained in:
2026-10-03 14:32:34 +02:00
parent 3da45a9da7
commit 20a191e7e9
4 changed files with 28 additions and 6 deletions
+10
View File
@@ -8,6 +8,7 @@ import { adfToMarkdown } from '../markdown/emit/adf-to-markdown.ts'
import { adfToPlainMarkdown, reduceToPlain } from '../markdown/emit/plain-reduction.ts'
import { directivePrefix } from '../markdown/directive-syntax.ts'
import { markdownToAdf, plainMarkdownToAdf } from '../markdown/parse/markdown-to-adf.ts'
import { toEditorNormal } from '../adf/editor-normal.ts'
const gateRuns = 1600
const renamedPrefix = '!adg:'
@@ -61,3 +62,12 @@ test('a generated document writes plain markdown refusing only what the guard re
propertyRuns(gateRuns),
)
})
test('a generated document writes the plain markdown its editor-normal form writes', { timeout: propertyTimeout }, () => {
fc.assert(
fc.property(adfDocument, (document) => {
assert.deepEqual(adfToPlainMarkdown(document), adfToPlainMarkdown(toEditorNormal(document)))
}),
propertyRuns(gateRuns),
)
})