@testable import PureYAML import Testing @Suite("Bare documents after a document-end marker") struct BareDocumentAfterEndTests { @Test("Content after `...` is a new bare document") func test_bareDocumentAfterEnd() throws { // A document started with `---`, ended with `...`, then a bare document follows. let documents = try PureYAML.parseStream("---\nscalar1\n...\nkey: value\n") #expect(documents.count == 2) #expect(documents[0].value == .string("scalar1")) #expect(documents[1].value == .mapping(.init([.init(key: "key", value: .string("value"))]))) } @Test("A `...` with nothing after it leaves a single document") func test_trailingEndMarkerLeavesOneDocument() throws { let documents = try PureYAML.parseStream("a\n...\n") #expect(documents.count == 1) #expect(documents[0].value == .string("a")) } }