Created
February 4, 2022 22:01
-
-
Save brianmichel/df992e18f4d4b69a151f08f5f98147d7 to your computer and use it in GitHub Desktop.
A patch for a new test to exercise the Appcast parsing behavior in Sparkle for my failing updater.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Tests/SUAppcastTest.swift b/Tests/SUAppcastTest.swift | |
index a1e921db..336e959b 100644 | |
--- a/Tests/SUAppcastTest.swift | |
+++ b/Tests/SUAppcastTest.swift | |
@@ -11,6 +11,27 @@ import Sparkle | |
class SUAppcastTest: XCTestCase { | |
+ func testBrokenAppcast() { | |
+ let testURL = Bundle(for: SUAppcastTest.self).url(forResource: "marconio-broken-appcast", withExtension: "xml")! | |
+ | |
+ do { | |
+ let testData = try Data(contentsOf: testURL) | |
+ | |
+ let versionComparator = SUStandardVersionComparator.default | |
+ let hostVersion = "1.0" | |
+ | |
+ let stateResolver = SPUAppcastItemStateResolver(hostVersion: hostVersion, | |
+ applicationVersionComparator: versionComparator, | |
+ standardVersionComparator: versionComparator) | |
+ let appcast = try SUAppcast(xmlData: testData, relativeTo: URL(string: "https://brianmichel.github.io/Marconio/appcast.xml")!, stateResolver: stateResolver) | |
+ | |
+ XCTAssertNotNil(appcast) | |
+ } catch let err as NSError { | |
+ NSLog("%@", err) | |
+ XCTFail(err.localizedDescription) | |
+ } | |
+ } | |
+ | |
func testParseAppcast() { | |
let testURL = Bundle(for: SUAppcastTest.self).url(forResource: "testappcast", withExtension: "xml")! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment