From 25e94de5c5c963773a2d08c51e66bb7f9133fd2c Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 30 Oct 2026 21:56:30 -0700 Subject: [PATCH] Test that relative image URL is skipped when baseURL is nil. --- .../Tests/RSParserTests/HTML/HTMLImageParserTests.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Modules/RSParser/Tests/RSParserTests/HTML/HTMLImageParserTests.swift b/Modules/RSParser/Tests/RSParserTests/HTML/HTMLImageParserTests.swift index 183a7c700..449084cf1 100644 --- a/Modules/RSParser/Tests/RSParserTests/HTML/HTMLImageParserTests.swift +++ b/Modules/RSParser/Tests/RSParserTests/HTML/HTMLImageParserTests.swift @@ -111,6 +111,12 @@ import RSParser #expect(firstSignificantImage(#""#)?.urlString == "https://cdn.example.net/a.jpg") } + @Test func relativeURLIsSkippedWithoutBaseURL() { + let html = #""# + let images = HTMLImageParser.significantImages(html: html, baseURL: nil, maximumCount: 3) + #expect(images.map(\.urlString) == ["https://example.com/b.jpg"]) + } + @Test func dimensionsInPixelsAreParsed() { let html = #""# #expect(firstSignificantImage(html) == HTMLImage(urlString: "https://example.com/a.jpg", width: nil, height: 300))