Name the position a directive name the other one spells belongs to
CI / gate (push) Successful in 8s
CI / gate (push) Successful in 8s
This commit is contained in:
@@ -8,6 +8,7 @@ import type { AttributeKind, AttributeVocabulary } from './adf/attribute-vocabul
|
||||
import { blockDirectives } from './adf/block-directives.ts'
|
||||
import { inlineDirectives } from './adf/inline-directives.ts'
|
||||
import { markAttributes } from './adf/mark-attributes.ts'
|
||||
import { textDirectiveName } from './markdown/text-directive.ts'
|
||||
|
||||
type Declared = { attributes: AttributeVocabulary }
|
||||
|
||||
@@ -96,6 +97,12 @@ test('the inline node table holds the attributes spec/flavour.md gives each node
|
||||
assert.deepEqual(declarations('Inline nodes'), vocabularies(inlineDirectives))
|
||||
})
|
||||
|
||||
// A name in two tables would make the position a directive is read in ambiguous.
|
||||
test('no name is spelled in more than one position', () => {
|
||||
const names = [...Object.keys(blockDirectives), ...Object.keys(inlineDirectives), ...Object.keys(markAttributes), textDirectiveName]
|
||||
assert.equal(new Set(names).size, names.length)
|
||||
})
|
||||
|
||||
test('the mark table holds the attributes spec/flavour.md gives each mark', () => {
|
||||
assert.deepEqual(declarations('Marks'), vocabularies(Object.fromEntries(Object.entries(markAttributes).map(([type, attributes]) => [type, { attributes }]))))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user