Skip to content

Commit

Permalink
fix(test-events): Do not skip events for only apparently empty documents
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Mar 20, 2022
1 parent e20fc39 commit 5ecfc50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/test-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ export function testEvents(src: string) {
if (error && (!error.pos || error.pos[0] < rootStart)) throw new Error()
let docStart = '+DOC'
if (doc.directives.docStart) docStart += ' ---'
else if (doc.contents && doc.contents.range[2] === doc.contents.range[0])
else if (
doc.contents &&
doc.contents.range[2] === doc.contents.range[0] &&
!doc.contents.anchor &&
!doc.contents.tag
)
continue
events.push(docStart)
addEvents(events, doc, error?.pos[0] ?? -1, root)
Expand Down
1 change: 0 additions & 1 deletion tests/yaml-test-suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const skip: Record<string, boolean | string[]> = {
'JEF9/02': true,
'M2N8/00': true,
'MUS6/00': ['errors'],
'UKK6/02': ['test.event'],
'Y79Y/003': ['errors'],
'Y79Y/004': ['errors'],
'Y79Y/005': ['errors'],
Expand Down

0 comments on commit 5ecfc50

Please sign in to comment.