Skip to content

Commit d967fbd

Browse files
committed
Disable tests that use the internet
Plist DTDs were recently moved from http://www.apple.com/DTDs/PropertyList-1.0.dtd to https://www.apple.com/DTDs/PropertyList-1.0.dtd (note the https). libXML, however, is not setup to request DTDs from secure domains and fails. This causes a spurious failure in the validation test checking for failure and a real failure in the validation test checking for success. In either case, these tests introduce a hard dependency on the internet into the test suite. I’ve disabled them for now and filed rdar://31567922 about this.
1 parent b5797e8 commit d967fbd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

TestFoundation/TestNSXMLDocument.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ class TestNSXMLDocument : XCTestCase {
289289
XCTAssertEqual(element.localName, "root")
290290
}
291291

292+
/*
293+
* <rdar://31567922> Re-enable these tests in a way that does not depend on the internet.
292294
func test_validation_success() throws {
293295
let validString = "<?xml version=\"1.0\" standalone=\"yes\"?><!DOCTYPE foo [ <!ELEMENT foo (#PCDATA)> ]><foo>Hello world</foo>"
294296
do {
@@ -330,7 +332,7 @@ class TestNSXMLDocument : XCTestCase {
330332
} catch let error as NSError {
331333
XCTAssert((error.userInfo[NSLocalizedDescriptionKey] as! String).contains("Element true was declared EMPTY this one has content"))
332334
}
333-
}
335+
}*/
334336

335337
func test_dtd() throws {
336338
let node = XMLNode.dtdNode(withXMLString:"<!ELEMENT foo (#PCDATA)>") as! XMLDTDNode

0 commit comments

Comments
 (0)