@testable import PureYAML import Testing @Suite("Explicit keys") struct ExplicitKeyTests { @Test("Explicit keys with no value each map to null") func test_explicitKeysWithoutValuesMapToNull() throws { // Several `? key` entries in a row (a set, for instance) are valid; each maps to null. let value = try PureYAML.parse(""" ? a ? b c: """) #expect(value == .mapping(.init([ .init(key: "a", value: .null), .init(key: "b", value: .null), .init(key: "c", value: .null), ]))) } @Test("Explicit keys with values still parse") func test_explicitKeysWithValues() throws { let value = try PureYAML.parse(""" ? a : b ? c : d """) #expect(value == .mapping(.init([ .init(key: "a", value: .string("b")), .init(key: "c", value: .string("d")), ]))) } }