Skip to content

Commit f3c7d03

Browse files
committed
test: Obey yaml-test-suite skip instructions
1 parent 4e66d72 commit f3c7d03

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/yaml-test-suite.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ type TestCase = {
1313
dump?: string
1414
}
1515

16-
type TestFile = [TestCase & { name: string }, ...TestCase[]]
16+
type TestFile = [TestCase & { name: string; skip?: boolean }, ...TestCase[]]
1717

1818
const skip: Record<string, boolean | string[]> = {
19-
'2JQS/0': ['test.event', 'errors'], //
19+
'2JQS/0': ['test.event', 'errors'], // duplicate empty keys are invalid
2020
'9MMA/0': ['errors'], // allow stream with directive & no docs
21-
'SF5V/0': ['errors'], // allow duplicate %YAML directives
22-
23-
// FIXME recent upstream additions
24-
'ZYU8/2': ['errors']
21+
'SF5V/0': ['errors'] // allow duplicate %YAML directives
2522
}
2623

2724
function testJsonMatch(docs: Document[], json: string) {
@@ -58,6 +55,7 @@ for (const fn of readdirSync(testRoot)) {
5855
const file = readFileSync(path, 'utf8')
5956
const testData = parse(file) as TestFile
6057
if (!Array.isArray(testData)) throw new Error(`Unsupported test file: ${fn}`)
58+
if (testData[0].skip) continue
6159

6260
const name = `${id}: ${testData[0].name}`
6361
for (let i = 0; i < testData.length; ++i) {

0 commit comments

Comments
 (0)