Skip to content

Commit 4f28a6e

Browse files
refactor: lint
Signed-off-by: Fabrizio Demaria <fabrizio.f.demaria@gmail.com>
1 parent 40428ff commit 4f28a6e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Tests/OpenFeatureTests/AsyncLastWinsQueueTests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import XCTest
22
@testable import OpenFeature
33

44
class AsyncLastWinsQueueTests: XCTestCase {
5-
6-
// MARK: - Basic Behavior Tests
7-
85
func testSingleOperationExecutes() async throws {
96
let queue = AsyncLastWinsQueue()
107
let executed = ActorBox<Bool>(false)

Tests/OpenFeatureTests/ConcurrencyRaceConditionTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ConcurrencyRaceConditionTests: XCTestCase {
5555
XCTAssertTrue(contextMap.keys.contains("timestamp"), "Context should contain 'timestamp' attribute")
5656

5757
if let idValue = contextMap["id"] as? Int64 {
58-
let expectedId = Int64(targetingKey.replacingOccurrences(of: "user", with: ""))!
58+
let expectedId = Int64(targetingKey.replacingOccurrences(of: "user", with: ""))
5959
XCTAssertEqual(idValue, expectedId, "Context 'id' should match the targeting key number")
6060
} else {
6161
XCTFail("Context 'id' should be an Int64 value")
@@ -152,14 +152,14 @@ class ConcurrencyRaceConditionTests: XCTestCase {
152152
"Provider status '\(finalState.providerStatus)' should be in a valid state after high-frequency operations"
153153
)
154154
if finalState.provider != nil && finalState.evaluationContext != nil {
155-
let context = finalState.evaluationContext!
156-
let targetingKey = context.getTargetingKey()
155+
let context = finalState.evaluationContext
156+
let targetingKey = context?.getTargetingKey() ?? ""
157157
XCTAssertTrue(
158158
targetingKey.hasPrefix("rapid-user"),
159159
"Final targeting key '\(targetingKey)' should be from the rapid operations if context exists"
160160
)
161161

162-
let contextMap = context.asObjectMap()
162+
let contextMap = context?.asObjectMap() ?? [:]
163163
if contextMap.keys.contains("iteration") {
164164
XCTAssertTrue(contextMap.keys.contains("timestamp"), "Context with iteration should also have timestamp")
165165
}

0 commit comments

Comments
 (0)