@testable import PureYAML import Testing @Suite("Multiline implicit keys") struct MultilineImplicitKeyTests { @Test("A quoted block implicit key that spans lines is rejected", arguments: [ "\"c\n d\": 1\n", // a double-quoted key across two lines "'c\n d': 1\n", // a single-quoted key across two lines ]) func test_multilineBlockKeyRejected(_ yaml: String) throws { #expect(throws: PureYAML.Parsing.ParseError.self) { try PureYAML.parse(yaml) } } @Test("Single-line keys, multiline values, flow keys, and explicit keys stay valid", arguments: [ "\"a b\": 1\n", // a single-line quoted key "k: \"a\n b\"\n", // a multiline quoted value (not a key), continuation indented "{ \"a\nb\": 1 }\n", // a flow mapping key may span lines "---\n- { \"multi\n line\": value}\n", // a multiline flow key inside a sequence "? \"a\n b\"\n: v\n", // an explicit key may span lines, continuation indented ]) func test_validQuotedKeysAndValues(_ yaml: String) throws { _ = try PureYAML.parse(yaml) } }