import Testing
@testable import PureXML
@Suite("XSD top-level attributeGroup applicability (topLevelAttributeGroup)")
struct SchemaTopLevelAttributeGroupTests {
private let xsd = "xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
private func compiles(_ body: String) -> Bool {
(try? PureXML.Schema.Document("\(body)")) != nil
}
@Test("A top-level attributeGroup with ref is rejected")
func test_topLevelForbiddenRejected() {
#expect(!compiles(""))
}
@Test("A plain top-level attributeGroup declaration compiles")
func test_plainTopLevelAccepted() {
#expect(compiles(""))
}
@Test("A local attributeGroup reference compiles")
func test_localRefAccepted() {
#expect(compiles(
""
+ ""
+ ""
+ "",
))
}
}