File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ open class XMLDTD : XMLNode {
26
26
}
27
27
28
28
public init ( ) {
29
- NSUnimplemented ( )
29
+ super . init ( kind : . DTDKind , options : [ ] )
30
30
}
31
31
32
32
public convenience init ( contentsOf url: URL , options mask: XMLNode . Options = [ ] ) throws {
Original file line number Diff line number Diff line change @@ -674,6 +674,17 @@ class TestXMLDocument : LoopbackServerTest {
674
674
_ = XMLNode ( )
675
675
}
676
676
677
+ func test_creatingAnEmptyDTD( ) {
678
+ let dtd = XMLDTD ( )
679
+ XCTAssertEqual ( dtd. publicID, " " )
680
+ XCTAssertEqual ( dtd. systemID, " " )
681
+ XCTAssertEqual ( dtd. children ?? [ ] , [ ] )
682
+
683
+ let plistDTDUrl = " https://www.apple.com/DTDs/PropertyList-1.0.dtd "
684
+ dtd. systemID = plistDTDUrl
685
+ XCTAssertEqual ( dtd. systemID, plistDTDUrl)
686
+ }
687
+
677
688
static var allTests : [ ( String , ( TestXMLDocument ) -> ( ) throws -> Void ) ] {
678
689
return [
679
690
( " test_basicCreation " , test_basicCreation) ,
@@ -707,6 +718,7 @@ class TestXMLDocument : LoopbackServerTest {
707
718
( " test_nodeKinds " , test_nodeKinds) ,
708
719
( " test_nodeNames " , test_nodeNames) ,
709
720
( " test_creatingAnEmptyDocumentAndNode " , test_creatingAnEmptyDocumentAndNode) ,
721
+ ( " test_creatingAnEmptyDTD " , test_creatingAnEmptyDTD) ,
710
722
]
711
723
}
712
724
}
You can’t perform that action at this time.
0 commit comments