diff --git a/PubNubMembership/Tests/MembershipTestHelpers.swift b/PubNubMembership/Tests/MembershipTestHelpers.swift index 142537e0..cca7ab77 100644 --- a/PubNubMembership/Tests/MembershipTestHelpers.swift +++ b/PubNubMembership/Tests/MembershipTestHelpers.swift @@ -101,6 +101,7 @@ extension EndpointResponse where Value == Data { init(data: Data?) { self.init( router: MockRouter(), + // swiftlint:disable:next force_unwrapping request: .init(url: URL(string: "example.com")!), response: .init(), payload: data ?? Data() diff --git a/PubNubSpace/Tests/SpaceTestHelpers.swift b/PubNubSpace/Tests/SpaceTestHelpers.swift index 63acf60c..6052aa96 100644 --- a/PubNubSpace/Tests/SpaceTestHelpers.swift +++ b/PubNubSpace/Tests/SpaceTestHelpers.swift @@ -101,6 +101,7 @@ extension EndpointResponse where Value == Data { init(data: Data?) { self.init( router: MockRouter(), + // swiftlint:disable:next force_unwrapping request: .init(url: URL(string: "example.com")!), response: .init(), payload: data ?? Data() diff --git a/PubNubUser/Tests/Test+PubNubUserPatcher.swift b/PubNubUser/Tests/Test+PubNubUserPatcher.swift index 3294ed47..24081c11 100644 --- a/PubNubUser/Tests/Test+PubNubUserPatcher.swift +++ b/PubNubUser/Tests/Test+PubNubUserPatcher.swift @@ -27,7 +27,6 @@ class PubNubUserPatcherTests: XCTestCase { eTag: "OldETag" ) - // swiftlint:disable:next force_unwrapping var patcher = PubNubUser.Patcher( id: "TestUserId", updated: .distantFuture, @@ -36,6 +35,7 @@ class PubNubUserPatcherTests: XCTestCase { type: .some("TestType"), status: .some("TestStatus"), externalId: .some("TestExternalId"), + // swiftlint:disable:next force_unwrapping profileURL: .some(URL(string: "http://example.com")!), email: .some("TestEmail"), custom: .some(UserCustom(value: "Tester")) @@ -54,7 +54,6 @@ class PubNubUserPatcherTests: XCTestCase { eTag: "TestETag" ) - // swiftlint:disable:next force_unwrapping func testPatcher_Init() { XCTAssertEqual(patcher.id, "TestUserId") XCTAssertEqual(patcher.updated, .distantFuture) @@ -63,6 +62,7 @@ class PubNubUserPatcherTests: XCTestCase { XCTAssertEqual(patcher.type, .some("TestType")) XCTAssertEqual(patcher.status, .some("TestStatus")) XCTAssertEqual(patcher.externalId, .some("TestExternalId")) + // swiftlint:disable:next force_unwrapping XCTAssertEqual(patcher.profileURL, .some(URL(string: "http://example.com")!)) XCTAssertEqual(patcher.email, .some("TestEmail")) XCTAssertEqual( diff --git a/PubNubUser/Tests/UserTestHelpers.swift b/PubNubUser/Tests/UserTestHelpers.swift index 84afb347..e84e81c6 100644 --- a/PubNubUser/Tests/UserTestHelpers.swift +++ b/PubNubUser/Tests/UserTestHelpers.swift @@ -100,6 +100,7 @@ extension EndpointResponse where Value == Data { init(data: Data?) { self.init( router: MockRouter(), + // swiftlint:disable:next force_unwrapping request: .init(url: URL(string: "example.com")!), response: .init(), payload: data ?? Data() diff --git a/Sources/PubNub/EventEngine/Subscribe/Subscribe.swift b/Sources/PubNub/EventEngine/Subscribe/Subscribe.swift index cb783177..c5a8ba8a 100644 --- a/Sources/PubNub/EventEngine/Subscribe/Subscribe.swift +++ b/Sources/PubNub/EventEngine/Subscribe/Subscribe.swift @@ -101,6 +101,7 @@ extension Subscribe { } struct UnsubscribedState: SubscribeState { + // swiftlint:disable:next force_unwrapping let cursor: SubscribeCursor = .init(timetoken: 0)! let input: SubscribeInput = .init() let connectionStatus = ConnectionStatus.disconnected diff --git a/Sources/PubNub/Networking/HTTPFileTask.swift b/Sources/PubNub/Networking/HTTPFileTask.swift index d315eafc..ecbfabcc 100644 --- a/Sources/PubNub/Networking/HTTPFileTask.swift +++ b/Sources/PubNub/Networking/HTTPFileTask.swift @@ -73,7 +73,7 @@ public class HTTPFileTask: Hashable { func updateProgress(bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { // Progress is handled automatically on iOS 11+ - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { } else { + if #unavailable(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0) { progress.completedUnitCount = totalBytesWritten }