@testable import PureYAML import Testing @Suite("Unkeyed Container Edges") struct UnkeyedContainerEdgeTests { @Test("decodeNil returns false for present values and still decodes them") func test_unkeyedDecodeNilFalseBranchDecodesPresentValues() throws { let decoded = try PureYAML.decode([Int?].self, from: .sequence([.int(1), .null, .int(2)])) #expect(decoded == [1, nil, 2]) } @Test("A nested unkeyed container type mismatch reports the index path") func test_unkeyedNestedContainerMismatchReportsIndexPath() { do { _ = try PureYAML.decode([[Int]].self, from: .sequence([.int(1)])) Issue.record("expected a decoding error") } catch let error as PureYAML.Decoding.Error { #expect(error.description == "Expected sequence at $[0], found int") } catch { Issue.record("unexpected error \(error)") } } }