@@ -39,6 +39,7 @@ class TestXMLDocument : LoopbackServerTest {
39
39
( " test_optionPreserveAll " , test_optionPreserveAll) ,
40
40
( " test_rootElementRetainsDocument " , test_rootElementRetainsDocument) ,
41
41
( " test_nodeKinds " , test_nodeKinds) ,
42
+ ( " test_sr10776_documentName " , test_sr10776_documentName) ,
42
43
]
43
44
}
44
45
@@ -551,7 +552,7 @@ class TestXMLDocument : LoopbackServerTest {
551
552
552
553
XCTAssertEqual ( try ? test ( ) , " plans " )
553
554
}
554
-
555
+
555
556
func test_nodeKinds( ) {
556
557
XCTAssertEqual ( XMLDocument ( rootElement: nil ) . kind, . document)
557
558
XCTAssertEqual ( XMLElement ( name: " prefix:localName " ) . kind, . element)
@@ -565,6 +566,13 @@ class TestXMLDocument : LoopbackServerTest {
565
566
XCTAssertEqual ( XMLDTDNode ( xmlString: " <!ATTLIST A B CDATA #IMPLIED> " ) ? . kind, . attributeDeclaration)
566
567
XCTAssertEqual ( XMLDTDNode ( xmlString: " <!ELEMENT E EMPTY> " ) ? . kind, . elementDeclaration)
567
568
XCTAssertEqual ( XMLDTDNode ( xmlString: #"<!NOTATION f SYSTEM "F">"# ) ? . kind, . notationDeclaration)
569
+
570
+ func test_sr10776_documentName( ) {
571
+ let doc = XMLDocument ( rootElement: nil )
572
+ XCTAssertNil ( doc. name)
573
+
574
+ doc. name = " name "
575
+ XCTAssertNil ( doc. name) // `name` of XMLDocument is always nil.
568
576
}
569
577
}
570
578
0 commit comments