diff --git a/Frameworks/RSParser/RSParserTests/RSSParserTests.swift b/Frameworks/RSParser/RSParserTests/RSSParserTests.swift index 36c4f5091..deecde88c 100644 --- a/Frameworks/RSParser/RSParserTests/RSSParserTests.swift +++ b/Frameworks/RSParser/RSParserTests/RSSParserTests.swift @@ -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 + } + + } }