@testable import PureYAML import Testing @Suite("Document markers inside multi-line scalars") struct DocumentMarkerInScalarTests { @Test("A `---` or `...` line inside a multi-line quoted scalar is rejected", arguments: [ "---\n\"\n---\n\"\n", // a `---` line inside a double-quoted scalar "---\n'\n...\n'\n", // a `...` line inside a single-quoted scalar ]) func test_documentMarkerInScalarRejected(_ yaml: String) throws { #expect(throws: PureYAML.Parsing.ParseError.self) { try PureYAML.parse(yaml) } } @Test("Dashes and dots that are not a line-start marker stay valid", arguments: [ "\"a --- b\"\n", // dashes inline, not at a line start "\"a\n---b\"\n", // `---` without a following boundary is content "\"a\nb\"\n", // an ordinary multi-line quoted scalar "\"...x\"\n", // dots not at a line start ]) func test_nonMarkerContentStaysValid(_ yaml: String) throws { _ = try PureYAML.parse(yaml) } }