mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add test case for bad titles in an Atom feed <https://github.com/Ranchero-Software/NetNewsWire/issues/4422>
This commit is contained in:
@@ -104,4 +104,26 @@ final class AtomParserTests: XCTestCase {
|
||||
XCTAssertEqual(attachment.mimeType!, "audio/mpeg")
|
||||
}
|
||||
}
|
||||
|
||||
func testIgnoringBadTitle() {
|
||||
|
||||
// This feed has a title tag inside a thing, like this,
|
||||
// and we need to ignore the title.
|
||||
// https://github.com/Ranchero-Software/NetNewsWire/issues/4422
|
||||
//
|
||||
// <s:variant>
|
||||
// <id>https://draw-down.com/products/8726135046398</id>
|
||||
// <title>Default Title</title>
|
||||
// <s:price currency="USD">38.50</s:price>
|
||||
// <s:sku/>
|
||||
// <s:grams>862</s:grams>
|
||||
// </s:variant>
|
||||
|
||||
let d = parserData("draw-down", "atom", "https://draw-down.com/collections/magazines.atom")
|
||||
let parsedFeed = try! FeedParser.parse(d)!
|
||||
|
||||
for article in parsedFeed.items {
|
||||
XCTAssertNotEqual(article.title, "Default Title")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1146
Modules/Parser/Tests/ParserTests/Resources/draw-down.atom
Normal file
1146
Modules/Parser/Tests/ParserTests/Resources/draw-down.atom
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user