#if os(macOS) import XCTest @testable import RastrilloMacUpdates @MainActor final class ConfigurationTests: XCTestCase { func testOnlyConfiguredHTTPSFeedWithEd25519KeyCanStart() { let key = Data(repeating: 7, count: 32).base64EncodedString() XCTAssertTrue(NativeUpdater.validConfiguration(["SUFeedURL": "https://raw.amadan.net/oficina/native-releases/main/docs/appcast.xml", "SUPublicEDKey": key])) for feed in ["http://example.com/feed.xml", "https://token@example.com/feed.xml", "https://example.com/feed.xml#fragment", "https://"] { XCTAssertFalse(NativeUpdater.validConfiguration(["SUFeedURL": feed, "SUPublicEDKey": key])) } XCTAssertFalse(NativeUpdater.validConfiguration([:])) XCTAssertFalse(NativeUpdater.validConfiguration(["SUFeedURL": "https://example.com/feed.xml", "SUPublicEDKey": Data(repeating: 7, count: 31).base64EncodedString()])) } func testDevelopmentBundleDoesNotStartUpdater() { let updater = NativeUpdater() XCTAssertFalse(updater.isConfigured) XCTAssertFalse(updater.canCheckForUpdates) updater.checkForUpdates() updater.automaticallyChecksForUpdates = true XCTAssertFalse(updater.automaticallyChecksForUpdates) } } #endif