Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ final class RetryPolicyServiceLoggerTests: XCTestCase {
// when
_ = try? await sut.retry(strategy: nil, onFailure: nil) {
attempt.increment()
if attempt.value < 3 { throw URLError(.notConnectedToInternet) }
if attempt.value < 3 {
throw URLError(.notConnectedToInternet)
}
return 42
}

Expand All @@ -58,7 +60,9 @@ final class RetryPolicyServiceLoggerTests: XCTestCase {

_ = try await sut.retry(strategy: nil, onFailure: nil) {
attempt.increment()
if attempt.value < 2 { throw URLError(.notConnectedToInternet) }
if attempt.value < 2 {
throw URLError(.notConnectedToInternet)
}
return 42
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ final class RetryPolicyServiceRetryWithResultTests: XCTestCase {
// when
let result = try await sut.retryWithResult {
counter.increment()
if counter.value < 2 { throw TestError.transient }
if counter.value < 2 {
throw TestError.transient
}
return true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ final class RetryPolicyServiceTests: XCTestCase {
// when
let result = try await service.retry {
let count = counter.increment()
if count >= 3 { return expectedValue }
if count >= 3 {
return expectedValue
}
throw URLError(.unknown)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@

await setHandler {
let count = counter.increment()
if count < 2 { throw URLError(.notConnectedToInternet) }
if count < 2 {
throw URLError(.notConnectedToInternet)
}
return (.ok, Data(String.data.utf8))
}

Expand Down Expand Up @@ -149,7 +151,9 @@

await setHandler {
let count = counter.increment()
if count < 3 { throw URLError(.timedOut) }
if count < 3 {
throw URLError(.timedOut)
}
return (.ok, Data(String.data.utf8))
}

Expand All @@ -173,7 +177,9 @@

await setHandler {
let count = counter.increment()
if count < 2 { throw URLError(.networkConnectionLost) }
if count < 2 {
throw URLError(.networkConnectionLost)
}
return (.ok, Data())
}

Expand All @@ -196,7 +202,9 @@

await setHandler {
let count = counter.increment()
if count < 2 { throw URLError(.timedOut) }
if count < 2 {
throw URLError(.timedOut)
}
return (.ok, Data(String.data.utf8))
}

Expand Down
Loading