Fix build failures in OPMLTests. Tests all still pass in RSParser.

This commit is contained in:
Brent Simmons 2017-11-04 10:25:13 -07:00
parent 5b34ed5432
commit 2bb0cdb0ba

View File

@ -35,14 +35,14 @@ class OPMLTests: XCTestCase {
func recursivelyCheckOPMLStructure(_ item: RSOPMLItem) { func recursivelyCheckOPMLStructure(_ item: RSOPMLItem) {
let feedSpecifier = item.opmlFeedSpecifier let feedSpecifier = item.feedSpecifier
if !(item is RSOPMLDocument) { if !(item is RSOPMLDocument) {
XCTAssertNotNil((item.attributes as NSDictionary).opml_text) XCTAssertNotNil((item.attributes! as NSDictionary).opml_text)
} }
// If it has no children, it should have a feed specifier. The converse is also true. // If it has no children, it should have a feed specifier. The converse is also true.
var isFolder = item.children != nil && item.children.count > 0 var isFolder = item.children != nil && item.children!.count > 0
if !isFolder && (item.attributes as NSDictionary).opml_title == "Skip" { if !isFolder && (item.attributes! as NSDictionary).opml_title == "Skip" {
isFolder = true isFolder = true
} }
@ -53,12 +53,12 @@ class OPMLTests: XCTestCase {
else { else {
XCTAssertNil(feedSpecifier) XCTAssertNil(feedSpecifier)
if !(item is RSOPMLDocument) { if !(item is RSOPMLDocument) {
XCTAssertNotNil((item.attributes as NSDictionary).opml_title) XCTAssertNotNil((item.attributes! as NSDictionary).opml_title)
} }
} }
if item.children != nil && item.children.count > 0 { if item.children != nil && item.children!.count > 0 {
for oneItem in item.children { for oneItem in item.children! {
recursivelyCheckOPMLStructure(oneItem) recursivelyCheckOPMLStructure(oneItem)
} }
} }