3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-18 22:25:44 +01:00

Answer stability round 1: 0 🔴, 2 🟡 (0 misread); test each pair once, and log the breaking reading

This commit is contained in:
2026-11-15 22:39:02 +01:00
committed by Lillem4n
parent e8a491072c
commit 1ad449f083
5 changed files with 2 additions and 21 deletions
+1 -7
View File
@@ -24,7 +24,7 @@ const mappings = new Map(
.map((match): [string, string] => [characters(match[1] ?? ''), characters(match[2] ?? '')]),
)
test('the vendored file gives the mappings the other tests hold the table to', () => {
test('the vendored file holds 1606 common and full mappings, `ẞ`, `ß` and `İ` among them', () => {
assert.equal(mappings.size, 1606)
assert.equal(mappings.get('ẞ'), 'ss')
assert.equal(mappings.get('ß'), 'ss')
@@ -52,9 +52,3 @@ test('folds a string code point by code point, a surrogate pair as one', () => {
assert.equal(foldCase(''), '')
assert.equal(foldCase('\ud801'), '\ud801')
})
test('keeps the dotless i and the capital I apart, as the standard does', () => {
assert.equal(foldCase('I'), 'i')
assert.equal(foldCase('ı'), 'ı')
assert.notEqual(foldCase('ı'), foldCase('I'))
})
@@ -51,8 +51,6 @@ test('a target reads whitespace and a title around its destination, bracketed, u
test('a label folds under Unicode case folding after its whitespace collapses', () => {
assert.equal(normalizeLabel(' Foo \n\t Bar '), 'foo bar')
assert.equal(normalizeLabel('ẞ'), normalizeLabel('SS'))
assert.equal(normalizeLabel('Straße'), normalizeLabel('STRASSE'))
assert.equal(normalizeLabel('ς'), normalizeLabel('Σ'))
})
test('a dotless i and a capital I stay two labels', () => {
@@ -1083,8 +1083,6 @@ test('reads the reference links a definition resolves, and leaves the rest liter
for (const read of [commonMarkToAdf, losslessMarkdownToAdf, portableMarkdownToAdf]) {
test(`matches a reference to its definition under Unicode case folding in ${read.name}`, () => {
assert.deepEqual(content(read('[ẞ]\n\n[SS]: /url\n')), [{ content: [marked('ẞ', link('/url'))], type: 'paragraph' }])
assert.deepEqual(content(read('[Straße][]\n\n[STRASSE]: /url\n')), [{ content: [marked('Straße', link('/url'))], type: 'paragraph' }])
assert.deepEqual(content(read('[a][ς]\n\n[Σ]: /url\n')), [{ content: [marked('a', link('/url'))], type: 'paragraph' }])
})
test(`keeps a dotless i and a capital I two labels in ${read.name}`, () => {