diff --git a/Tests/InlineBlockSequenceValueTests.swift b/Tests/InlineBlockSequenceValueTests.swift index 528e298..600d986 100644 --- a/Tests/InlineBlockSequenceValueTests.swift +++ b/Tests/InlineBlockSequenceValueTests.swift @@ -23,12 +23,14 @@ struct InlineBlockSequenceValueTests { _ = try PureYAML.parse(yaml) } - @Test("An explicit key's value on its own `:` line is not rejected as inline") - func test_explicitKeyCompactSequenceValueNotRejected() throws { + @Test("An explicit key's compact block-sequence value parses to its two distinct items") + func test_explicitKeyCompactSequenceValue() throws { // The `:` opens the line, so it is an explicit-key value indicator and the compact sequence - // after it is allowed: the reject above is specific to an implicit key. The element folding - // of an explicit-key compact sequence is a separate, pre-existing concern, so this asserts - // only that the construct still parses rather than its exact value. - _ = try PureYAML.parse("? k\n: - a\n - b\n") + // after it is a block sequence under `k`: the implicit-key reject above does not apply. The + // two entries stay distinct items rather than folding into a single `"a - b"` scalar. + let value = try PureYAML.parse("? k\n: - a\n - b\n") + #expect(value == .mapping(.init([ + .init(key: "k", value: .sequence([.string("a"), .string("b")])), + ]))) } }