Commit ac7de0ce3c
Unsigned
Layout: unified · split
Hutch.xcodeproj/project.pbxproj +8 −8
| @@ -517,7 +517,7 @@ | |||
| 517 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; | 517 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 518 | CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements; | 518 | CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements; |
| 519 | CODE_SIGN_STYLE = Automatic; | 519 | CODE_SIGN_STYLE = Automatic; |
| 520 | CURRENT_PROJECT_VERSION = 78; | 520 | CURRENT_PROJECT_VERSION = 79; |
| 521 | DEVELOPMENT_TEAM = ZCNAX3VL9D; | 521 | DEVELOPMENT_TEAM = ZCNAX3VL9D; |
| 522 | ENABLE_PREVIEWS = YES; | 522 | ENABLE_PREVIEWS = YES; |
| 523 | GENERATE_INFOPLIST_FILE = YES; | 523 | GENERATE_INFOPLIST_FILE = YES; |
| @@ -534,7 +534,7 @@ | |||
| 534 | "$(inherited)", | 534 | "$(inherited)", |
| 535 | "@executable_path/Frameworks", | 535 | "@executable_path/Frameworks", |
| 536 | ); | 536 | ); |
| 537 | MARKETING_VERSION = 3.1.10; | 537 | MARKETING_VERSION = 3.1.11; |
| 538 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch; | 538 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch; |
| 539 | PRODUCT_NAME = "$(TARGET_NAME)"; | 539 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 540 | STRING_CATALOG_GENERATE_SYMBOLS = YES; | 540 | STRING_CATALOG_GENERATE_SYMBOLS = YES; |
| @@ -554,7 +554,7 @@ | |||
| 554 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; | 554 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 555 | CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements; | 555 | CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements; |
| 556 | CODE_SIGN_STYLE = Automatic; | 556 | CODE_SIGN_STYLE = Automatic; |
| 557 | CURRENT_PROJECT_VERSION = 78; | 557 | CURRENT_PROJECT_VERSION = 79; |
| 558 | DEVELOPMENT_TEAM = ZCNAX3VL9D; | 558 | DEVELOPMENT_TEAM = ZCNAX3VL9D; |
| 559 | ENABLE_PREVIEWS = YES; | 559 | ENABLE_PREVIEWS = YES; |
| 560 | GENERATE_INFOPLIST_FILE = YES; | 560 | GENERATE_INFOPLIST_FILE = YES; |
| @@ -571,7 +571,7 @@ | |||
| 571 | "$(inherited)", | 571 | "$(inherited)", |
| 572 | "@executable_path/Frameworks", | 572 | "@executable_path/Frameworks", |
| 573 | ); | 573 | ); |
| 574 | MARKETING_VERSION = 3.1.10; | 574 | MARKETING_VERSION = 3.1.11; |
| 575 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch; | 575 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch; |
| 576 | PRODUCT_NAME = "$(TARGET_NAME)"; | 576 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 577 | STRING_CATALOG_GENERATE_SYMBOLS = YES; | 577 | STRING_CATALOG_GENERATE_SYMBOLS = YES; |
| @@ -634,7 +634,7 @@ | |||
| 634 | APPLICATION_EXTENSION_API_ONLY = YES; | 634 | APPLICATION_EXTENSION_API_ONLY = YES; |
| 635 | CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements; | 635 | CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements; |
| 636 | CODE_SIGN_STYLE = Automatic; | 636 | CODE_SIGN_STYLE = Automatic; |
| 637 | CURRENT_PROJECT_VERSION = 78; | 637 | CURRENT_PROJECT_VERSION = 79; |
| 638 | DEVELOPMENT_TEAM = ZCNAX3VL9D; | 638 | DEVELOPMENT_TEAM = ZCNAX3VL9D; |
| 639 | GENERATE_INFOPLIST_FILE = NO; | 639 | GENERATE_INFOPLIST_FILE = NO; |
| 640 | INFOPLIST_FILE = HutchWidgetExtension/Info.plist; | 640 | INFOPLIST_FILE = HutchWidgetExtension/Info.plist; |
| @@ -644,7 +644,7 @@ | |||
| 644 | "@executable_path/Frameworks", | 644 | "@executable_path/Frameworks", |
| 645 | "@executable_path/../../Frameworks", | 645 | "@executable_path/../../Frameworks", |
| 646 | ); | 646 | ); |
| 647 | MARKETING_VERSION = 3.1.10; | 647 | MARKETING_VERSION = 3.1.11; |
| 648 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension; | 648 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension; |
| 649 | PRODUCT_NAME = "$(TARGET_NAME)"; | 649 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 650 | SKIP_INSTALL = YES; | 650 | SKIP_INSTALL = YES; |
| @@ -663,7 +663,7 @@ | |||
| 663 | APPLICATION_EXTENSION_API_ONLY = YES; | 663 | APPLICATION_EXTENSION_API_ONLY = YES; |
| 664 | CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements; | 664 | CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements; |
| 665 | CODE_SIGN_STYLE = Automatic; | 665 | CODE_SIGN_STYLE = Automatic; |
| 666 | CURRENT_PROJECT_VERSION = 78; | 666 | CURRENT_PROJECT_VERSION = 79; |
| 667 | DEVELOPMENT_TEAM = ZCNAX3VL9D; | 667 | DEVELOPMENT_TEAM = ZCNAX3VL9D; |
| 668 | GENERATE_INFOPLIST_FILE = NO; | 668 | GENERATE_INFOPLIST_FILE = NO; |
| 669 | INFOPLIST_FILE = HutchWidgetExtension/Info.plist; | 669 | INFOPLIST_FILE = HutchWidgetExtension/Info.plist; |
| @@ -673,7 +673,7 @@ | |||
| 673 | "@executable_path/Frameworks", | 673 | "@executable_path/Frameworks", |
| 674 | "@executable_path/../../Frameworks", | 674 | "@executable_path/../../Frameworks", |
| 675 | ); | 675 | ); |
| 676 | MARKETING_VERSION = 3.1.10; | 676 | MARKETING_VERSION = 3.1.11; |
| 677 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension; | 677 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension; |
| 678 | PRODUCT_NAME = "$(TARGET_NAME)"; | 678 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 679 | SKIP_INSTALL = YES; | 679 | SKIP_INSTALL = YES; |
HutchTests/BundleUserAgentTests.swift +6 −4
| @@ -9,7 +9,7 @@ import Testing | |||
| 9 | private final class CapturingURLProtocol: URLProtocol, @unchecked Sendable { | 9 | private final class CapturingURLProtocol: URLProtocol, @unchecked Sendable { |
| 10 | nonisolated(unsafe) static var capturedRequests: [URLRequest] = [] | 10 | nonisolated(unsafe) static var capturedRequests: [URLRequest] = [] |
| 11 | 11 | ||
| 12 | override class func canInit(with request: URLRequest) -> Bool { true } | 12 | override class func canInit(with _: URLRequest) -> Bool { true } |
| 13 | override class func canonicalRequest(for request: URLRequest) -> URLRequest { request } | 13 | override class func canonicalRequest(for request: URLRequest) -> URLRequest { request } |
| 14 | 14 | ||
| 15 | override func startLoading() { | 15 | override func startLoading() { |
| @@ -25,7 +25,9 @@ private final class CapturingURLProtocol: URLProtocol, @unchecked Sendable { | |||
| 25 | client?.urlProtocolDidFinishLoading(self) | 25 | client?.urlProtocolDidFinishLoading(self) |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | override func stopLoading() {} | 28 | override func stopLoading() { |
| 29 | // No cleanup is needed because the stub responds immediately in `startLoading()`. | ||
| 30 | } | ||
| 29 | 31 | ||
| 30 | static func makeSession() -> URLSession { | 32 | static func makeSession() -> URLSession { |
| 31 | let config = URLSessionConfiguration.ephemeral | 33 | let config = URLSessionConfiguration.ephemeral |
| @@ -79,10 +81,10 @@ struct BundleUserAgentTests { | |||
| 79 | } | 81 | } |
| 80 | 82 | ||
| 81 | @Test | 83 | @Test |
| 82 | func sRHTClientSetsUserAgentOnFetchText() async { | 84 | func sRHTClientSetsUserAgentOnFetchText() async throws { |
| 83 | CapturingURLProtocol.capturedRequests = [] | 85 | CapturingURLProtocol.capturedRequests = [] |
| 84 | let client = SRHTClient(session: CapturingURLProtocol.makeSession(), token: "test-token") | 86 | let client = SRHTClient(session: CapturingURLProtocol.makeSession(), token: "test-token") |
| 85 | let url = try! #require(URL(string: "https://builds.sr.ht/~test/job/1/log")) | 87 | let url = try #require(URL(string: "https://builds.sr.ht/~test/job/1/log")) |
| 86 | 88 | ||
| 87 | _ = try? await client.fetchText(url: url) | 89 | _ = try? await client.fetchText(url: url) |
| 88 | 90 | ||