mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Test Omni Show and Macworld unique IDs. The Omni Show ids should come from the feed’s guids. Macworld’s unique IDs should be calculated, since the feed doesn’t have guids.
This commit is contained in:
@@ -71,7 +71,7 @@ class RSSParserTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
func testTheOmniShow() {
|
||||
func testTheOmniShowUniqueIDs() {
|
||||
|
||||
let d = parserData("theomnishow", "rss", "https://theomnishow.omnigroup.com/")
|
||||
let parsedFeed = try! FeedParser.parse(d)!
|
||||
@@ -81,4 +81,18 @@ class RSSParserTests: XCTestCase {
|
||||
XCTAssertTrue(article.uniqueID.hasPrefix("https://theomnishow.omnigroup.com/episode/"))
|
||||
}
|
||||
}
|
||||
|
||||
func testMacworldUniqueIDs() {
|
||||
|
||||
// Macworld’s feed doesn’t have guids, so they should be calculated unique IDs.
|
||||
|
||||
let d = parserData("macworld", "rss", "https://www.macworld.com/")
|
||||
let parsedFeed = try! FeedParser.parse(d)!
|
||||
|
||||
for article in parsedFeed.items {
|
||||
XCTAssertNotNil(article.uniqueID)
|
||||
XCTAssertEqual(article.uniqueID.count, 32) // calculated unique IDs are MD5 hashes
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user