import Testing @testable import PureXML /// A complex type whose `simpleContent` derives from a list or union simple type /// keeps that variety, so its element content is validated as a list/union rather /// than collapsing to an atomic value space. A `simpleContent` extension of a /// list-of-int validates its text as a list of ints: a non-int item is rejected. @Suite("simpleContent list/union variety") struct SchemaSimpleContentListTests { private func schema() throws -> PureXML.Schema.Document { try PureXML.Schema.Document(""" """) } @Test("a valid int-list simpleContent is accepted") func test_validListAccepted() throws { #expect(try schema().validate(#"1 2 3"#).isEmpty) } @Test("a non-int item in a list simpleContent is rejected") func test_invalidListItemRejected() throws { #expect(try !schema().validate(#"1 z 3"#).isEmpty) } }