From 09397f0a74f758ea0f13eea5b7250edaf7221056 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 20 Jan 2025 11:14:53 -0800 Subject: [PATCH] =?UTF-8?q?Fix=20allthis.atom=20test=20=E2=80=94=C2=A0it?= =?UTF-8?q?=20was=20misidentified=20=E2=80=94=C2=A0it=E2=80=99s=20actually?= =?UTF-8?q?=20an=20RSS=20feed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tests/ParserTests/AtomParserTests.swift | 17 ----------------- .../Tests/ParserTests/RSSParserTests.swift | 18 ++++++++++++++++++ .../Resources/{allthis.atom => allthis.rss} | 0 3 files changed, 18 insertions(+), 17 deletions(-) rename Modules/Parser/Tests/ParserTests/Resources/{allthis.atom => allthis.rss} (100%) diff --git a/Modules/Parser/Tests/ParserTests/AtomParserTests.swift b/Modules/Parser/Tests/ParserTests/AtomParserTests.swift index 544ba4ef9..39dd3b72e 100644 --- a/Modules/Parser/Tests/ParserTests/AtomParserTests.swift +++ b/Modules/Parser/Tests/ParserTests/AtomParserTests.swift @@ -20,23 +20,6 @@ final class AtomParserTests: XCTestCase { } } - func testAllThisPerformance() { - - // 0.003 sec on my 2012 iMac. - let d = parserData("allthis", "atom", "http://leancrew.com/all-this") - self.measure { - let _ = try! FeedParser.parse(d) - } - } - - func testGettingHomePageLink() { - - let d = parserData("allthis", "atom", "http://leancrew.com/all-this") - let parsedFeed = try! FeedParser.parse(d)! - - XCTAssertTrue(parsedFeed.homePageURL == "http://leancrew.com/all-this") - } - func testDaringFireball() { let d = parserData("DaringFireball", "atom", "http://daringfireball.net/") //It’s actually an Atom feed diff --git a/Modules/Parser/Tests/ParserTests/RSSParserTests.swift b/Modules/Parser/Tests/ParserTests/RSSParserTests.swift index 5b1344cad..b83def4f7 100644 --- a/Modules/Parser/Tests/ParserTests/RSSParserTests.swift +++ b/Modules/Parser/Tests/ParserTests/RSSParserTests.swift @@ -51,6 +51,24 @@ final class RSSParserTests: XCTestCase { } } + func testAllThisPerformance() { + + // 0.003 sec on my 2012 iMac. + // 0.002 2022 Mac Studio + let d = parserData("allthis", "rss", "http://leancrew.com/all-this") + self.measure { + let _ = try! FeedParser.parse(d) + } + } + + func testGettingHomePageLink() { + + let d = parserData("allthis", "rss", "http://leancrew.com/all-this") + let parsedFeed = try! FeedParser.parse(d)! + + XCTAssertTrue(parsedFeed.homePageURL == "http://leancrew.com/all-this") + } + func testNatashaTheRobot() async { let d = parserData("natasha", "xml", "https://www.natashatherobot.com/") diff --git a/Modules/Parser/Tests/ParserTests/Resources/allthis.atom b/Modules/Parser/Tests/ParserTests/Resources/allthis.rss similarity index 100% rename from Modules/Parser/Tests/ParserTests/Resources/allthis.atom rename to Modules/Parser/Tests/ParserTests/Resources/allthis.rss