Skip to content

Commit aac6e64

Browse files
committed
Fix redundant coalescing
1 parent e8fa1f7 commit aac6e64

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

Tests/NukeTests/ImagePipelineTests/ImagePipelineCoalescingTests.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import Testing
3535
let (image1, image2) = try await (task1, task2)
3636

3737
// Then the correct proessors are applied.
38-
#expect(image1.nk_test_processorIDs ?? [] == ["1"])
39-
#expect(image2.nk_test_processorIDs ?? [] == ["1"])
38+
#expect(image1.nk_test_processorIDs == ["1"])
39+
#expect(image2.nk_test_processorIDs == ["1"])
4040

4141
// Then the original image is loaded once
4242
#expect(dataLoader.createdTaskCount == 1)
@@ -58,8 +58,8 @@ import Testing
5858

5959
// Then the correct proessors are applied.
6060
// Then the correct proessors are applied.
61-
#expect(image1.nk_test_processorIDs ?? [] == ["1"])
62-
#expect(image2.nk_test_processorIDs ?? [] == ["2"])
61+
#expect(image1.nk_test_processorIDs == ["1"])
62+
#expect(image2.nk_test_processorIDs == ["2"])
6363

6464
// Then the original image is loaded once
6565
#expect(dataLoader.createdTaskCount == 1)
@@ -83,8 +83,8 @@ import Testing
8383
let (image1, image2) = try await (task1, task2)
8484

8585
// Then the correct proessors are applied.
86-
#expect(image1.nk_test_processorIDs ?? [] == ["1"])
87-
#expect(image2.nk_test_processorIDs ?? [] == [])
86+
#expect(image1.nk_test_processorIDs == ["1"])
87+
#expect(image2.nk_test_processorIDs == [])
8888

8989
// Then the original image is loaded once
9090
#expect(dataLoader.createdTaskCount == 1)
@@ -205,8 +205,8 @@ import Testing
205205
let image1 = try await task.value
206206

207207
// Then the images is still loaded and processors is applied
208-
#expect(image1.nk_test_processorIDs ?? [] == ["1"])
209-
#expect(image2.nk_test_processorIDs ?? [] == ["1"])
208+
#expect(image1.nk_test_processorIDs == ["1"])
209+
#expect(image2.nk_test_processorIDs == ["1"])
210210

211211
// Then the original image is loaded only once, but processors are
212212
// applied twice
@@ -233,14 +233,14 @@ import Testing
233233
let (image1, image2) = try await (task1, task2)
234234

235235
// Then the correct processors are applied.
236-
#expect(image1.nk_test_processorIDs ?? [] == ["1"])
237-
#expect(image2.nk_test_processorIDs ?? [] == ["2"])
236+
#expect(image1.nk_test_processorIDs == ["1"])
237+
#expect(image2.nk_test_processorIDs == ["2"])
238238

239239
// Then the images are stored in memory cache
240240
#expect(imageCache[request1] != nil)
241-
#expect(imageCache[request1]?.image.nk_test_processorIDs ?? [] == ["1"])
241+
#expect(imageCache[request1]?.image.nk_test_processorIDs == ["1"])
242242
#expect(imageCache[request2] != nil)
243-
#expect(imageCache[request2]?.image.nk_test_processorIDs ?? [] == ["2"])
243+
#expect(imageCache[request2]?.image.nk_test_processorIDs == ["2"])
244244
}
245245

246246
// MARK: - Cancellation

Tests/NukeTests/ImagePipelineTests/ImagePipelineProcessingDeduplicationTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ import Testing
3333
let (image1, image2) = try await (task1, task2)
3434

3535
// Then
36-
#expect(image1.nk_test_processorIDs ?? [] == ["1"])
37-
#expect(image2.nk_test_processorIDs ?? [] == ["1", "2"])
36+
#expect(image1.nk_test_processorIDs == ["1"])
37+
#expect(image2.nk_test_processorIDs == ["1", "2"])
3838

3939
// Then the processor "1" is only applied once
4040
#expect(processors.numberOfProcessorsApplied == 2)
@@ -120,8 +120,8 @@ import Testing
120120
let (image1, image2) = try await (task1, task2)
121121

122122
// Then
123-
#expect(image1.nk_test_processorIDs ?? [] == ["1"])
124-
#expect(image2.nk_test_processorIDs ?? [] == ["1", "2"])
123+
#expect(image1.nk_test_processorIDs == ["1"])
124+
#expect(image2.nk_test_processorIDs == ["1", "2"])
125125

126126
// Then the processor "1" is applied twice
127127
#expect(processors.numberOfProcessorsApplied == 3)

Tests/NukeTests/ImagePipelineTests/ImagePipelineProcessorTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import UIKit
3333
let image = try await pipeline.image(for: request)
3434

3535
// Then
36-
#expect(image.nk_test_processorIDs ?? [] == ["processor1"])
36+
#expect(image.nk_test_processorIDs == ["processor1"])
3737
}
3838

3939
// MARK: - Composing Filters
@@ -52,7 +52,7 @@ import UIKit
5252
let image = try await pipeline.image(for: request)
5353

5454
// Then
55-
#expect(image.nk_test_processorIDs ?? [] == ["processor1", "processor2"])
55+
#expect(image.nk_test_processorIDs == ["processor1", "processor2"])
5656
}
5757

5858
@Test func performingRequestWithoutProcessors() async throws {
@@ -63,7 +63,7 @@ import UIKit
6363
let image = try await pipeline.image(for: request)
6464

6565
// Then
66-
#expect(image.nk_test_processorIDs ?? [] == [])
66+
#expect(image.nk_test_processorIDs == [])
6767
}
6868

6969
// MARK: - Decompression

0 commit comments

Comments
 (0)