3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-21 07:32:58 +01:00

Answer stability round 1: 1 🔴, 6 🟡 (0 misread); a carry refuses where the walk finds it, tests pin each batching guard, the changelog names the nested emphasis still quadratic, item 158 files it

This commit is contained in:
2026-10-29 16:19:12 +01:00
parent 5201d73954
commit bb413a6421
9 changed files with 89 additions and 19 deletions
@@ -40,6 +40,15 @@ test('names the node a refusal came from, and no source the emitter never read',
assert.equal(position(adfToLosslessMarkdown(document(paragraph({ text: 'x', type: 'text' }), list))), undefined)
})
test('refuses a node whose carry nests too deep ahead of a later node in its line', () => {
let id: JsonValue = 'a'
for (let depth = 0; depth < largestNesting; depth += 1) id = { id }
const twiceStrong: AdfNode = { marks: [{ type: 'strong' }, { type: 'strong' }], text: 'x', type: 'text' }
const refused = adfToLosslessMarkdown(document(paragraph({ attrs: { id }, type: 'mention' }, twiceStrong)))
assert.equal(code(refused), 'unsupported-nesting-depth')
assert.deepEqual(path(refused), ['content', 0, 'content', 0])
})
test('refuses a value that is not an ADF document, naming the check it failed', () => {
assert.equal(markdown(adfToLosslessMarkdown({ type: 'doc', version: Number.NaN })), 'not-an-adf-document: an ADF document holds a version number: found NaN')
})