|
9 | 9 |
|
10 | 10 | class TestXMLDocument : LoopbackServerTest {
|
11 | 11 |
|
12 |
| - static var allTests: [(String, (TestXMLDocument) -> () throws -> Void)] { |
13 |
| - return [ |
14 |
| - ("test_basicCreation", test_basicCreation), |
15 |
| - ("test_nextPreviousNode", test_nextPreviousNode), |
16 |
| - // Disabled because of https://bugs.swift.org/browse/SR-10098 |
17 |
| - // ("test_xpath", test_xpath), |
18 |
| - ("test_elementCreation", test_elementCreation), |
19 |
| - ("test_elementChildren", test_elementChildren), |
20 |
| - ("test_stringValue", test_stringValue), |
21 |
| - ("test_objectValue", test_objectValue), |
22 |
| - ("test_attributes", test_attributes), |
23 |
| - ("test_attributesWithNamespace", test_attributesWithNamespace), |
24 |
| - ("test_comments", test_comments), |
25 |
| - ("test_processingInstruction", test_processingInstruction), |
26 |
| - ("test_parseXMLString", test_parseXMLString), |
27 |
| - ("test_prefixes", test_prefixes), |
28 |
| - /* ⚠️ */ ("test_validation_success", testExpectedToFail(test_validation_success, |
29 |
| - /* ⚠️ */ #"<https://bugs.swift.org/browse/SR-10643> Could not build URI for external subset "http://127.0.0.1:-2/DTDs/PropertyList-1.0.dtd""#)), |
30 |
| - /* ⚠️ */ ("test_validation_failure", testExpectedToFail(test_validation_failure, |
31 |
| - /* ⚠️ */ "<https://bugs.swift.org/browse/SR-10643> XCTAssert in last catch block fails")), |
32 |
| - ("test_dtd", test_dtd), |
33 |
| - ("test_documentWithDTD", test_documentWithDTD), |
34 |
| - ("test_dtd_attributes", test_dtd_attributes), |
35 |
| - ("test_documentWithEncodingSetDoesntCrash", test_documentWithEncodingSetDoesntCrash), |
36 |
| - ("test_nodeFindingWithNamespaces", test_nodeFindingWithNamespaces), |
37 |
| - ("test_createElement", test_createElement), |
38 |
| - ("test_addNamespace", test_addNamespace), |
39 |
| - ("test_removeNamespace", test_removeNamespace), |
40 |
| - ("test_optionPreserveAll", test_optionPreserveAll), |
41 |
| - ("test_rootElementRetainsDocument", test_rootElementRetainsDocument), |
42 |
| - ("test_nodeKinds", test_nodeKinds), |
43 |
| - ("test_sr10776_documentName", test_sr10776_documentName), |
44 |
| - ] |
45 |
| - } |
46 |
| - |
47 | 12 | func test_basicCreation() {
|
48 | 13 | let doc = XMLDocument(rootElement: nil)
|
49 | 14 | XCTAssert(doc.version == "1.0", "expected 1.0, got \(String(describing: doc.version))")
|
@@ -649,6 +614,47 @@ class TestXMLDocument : LoopbackServerTest {
|
649 | 614 | doc.name = "name"
|
650 | 615 | XCTAssertNil(doc.name) // `name` of XMLDocument is always nil.
|
651 | 616 | }
|
| 617 | + |
| 618 | + func test_creatingAnEmptyDocumentAndNode() { |
| 619 | + _ = XMLDocument() |
| 620 | + _ = XMLNode() |
| 621 | + } |
| 622 | + |
| 623 | + static var allTests: [(String, (TestXMLDocument) -> () throws -> Void)] { |
| 624 | + return [ |
| 625 | + ("test_basicCreation", test_basicCreation), |
| 626 | + ("test_nextPreviousNode", test_nextPreviousNode), |
| 627 | + // Disabled because of https://bugs.swift.org/browse/SR-10098 |
| 628 | + // ("test_xpath", test_xpath), |
| 629 | + ("test_elementCreation", test_elementCreation), |
| 630 | + ("test_elementChildren", test_elementChildren), |
| 631 | + ("test_stringValue", test_stringValue), |
| 632 | + ("test_objectValue", test_objectValue), |
| 633 | + ("test_attributes", test_attributes), |
| 634 | + ("test_attributesWithNamespace", test_attributesWithNamespace), |
| 635 | + ("test_comments", test_comments), |
| 636 | + ("test_processingInstruction", test_processingInstruction), |
| 637 | + ("test_parseXMLString", test_parseXMLString), |
| 638 | + ("test_prefixes", test_prefixes), |
| 639 | + /* ⚠️ */ ("test_validation_success", testExpectedToFail(test_validation_success, |
| 640 | + /* ⚠️ */ #"<https://bugs.swift.org/browse/SR-10643> Could not build URI for external subset "http://127.0.0.1:-2/DTDs/PropertyList-1.0.dtd""#)), |
| 641 | + /* ⚠️ */ ("test_validation_failure", testExpectedToFail(test_validation_failure, |
| 642 | + /* ⚠️ */ "<https://bugs.swift.org/browse/SR-10643> XCTAssert in last catch block fails")), |
| 643 | + ("test_dtd", test_dtd), |
| 644 | + ("test_documentWithDTD", test_documentWithDTD), |
| 645 | + ("test_dtd_attributes", test_dtd_attributes), |
| 646 | + ("test_documentWithEncodingSetDoesntCrash", test_documentWithEncodingSetDoesntCrash), |
| 647 | + ("test_nodeFindingWithNamespaces", test_nodeFindingWithNamespaces), |
| 648 | + ("test_createElement", test_createElement), |
| 649 | + ("test_addNamespace", test_addNamespace), |
| 650 | + ("test_removeNamespace", test_removeNamespace), |
| 651 | + ("test_optionPreserveAll", test_optionPreserveAll), |
| 652 | + ("test_rootElementRetainsDocument", test_rootElementRetainsDocument), |
| 653 | + ("test_nodeKinds", test_nodeKinds), |
| 654 | + ("test_sr10776_documentName", test_sr10776_documentName), |
| 655 | + ("test_creatingAnEmptyDocumentAndNode", test_creatingAnEmptyDocumentAndNode), |
| 656 | + ] |
| 657 | + } |
652 | 658 | }
|
653 | 659 |
|
654 | 660 | fileprivate extension XMLNode {
|
|
0 commit comments