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 @@ -620,6 +620,17 @@ class TestXMLDocument : LoopbackServerTest {
620
620
_ = XMLNode ( )
621
621
}
622
622
623
+ func test_creatingAnEmptyDTD( ) {
624
+ let dtd = XMLDTD ( )
625
+ XCTAssertEqual ( dtd. publicID, " " )
626
+ XCTAssertEqual ( dtd. systemID, " " )
627
+ XCTAssertEqual ( dtd. children ?? [ ] , [ ] )
628
+
629
+ let plistDTDUrl = " https://www.apple.com/DTDs/PropertyList-1.0.dtd "
630
+ dtd. systemID = plistDTDUrl
631
+ XCTAssertEqual ( dtd. systemID, plistDTDUrl)
632
+ }
633
+
623
634
static var allTests : [ ( String , ( TestXMLDocument ) -> ( ) throws -> Void ) ] {
624
635
return [
625
636
( " test_basicCreation " , test_basicCreation) ,
@@ -653,6 +664,7 @@ class TestXMLDocument : LoopbackServerTest {
653
664
( " test_nodeKinds " , test_nodeKinds) ,
654
665
( " test_sr10776_documentName " , test_sr10776_documentName) ,
655
666
( " test_creatingAnEmptyDocumentAndNode " , test_creatingAnEmptyDocumentAndNode) ,
667
+ ( " test_creatingAnEmptyDTD " , test_creatingAnEmptyDTD) ,
656
668
]
657
669
}
658
670
}
You can’t perform that action at this time.
0 commit comments