onevcat пре 7 година
родитељ
комит
cdd05d60d7

+ 1 - 1
.travis.yml

@@ -1,6 +1,6 @@
 language: objective-c
 language: objective-c
 os: osx
 os: osx
-osx_image: xcode9
+osx_image: xcode9.3beta
 
 
 env:
 env:
   matrix:
   matrix:

+ 1 - 1
Tests/KingfisherTests/ImagePrefetcherTests.swift

@@ -90,7 +90,7 @@ class ImagePrefetcherTests: XCTestCase {
         let expectation = self.expectation(description: "wait for prefetching images")
         let expectation = self.expectation(description: "wait for prefetching images")
         
         
         var urls = [URL]()
         var urls = [URL]()
-        var responses = [LSStubResponseDSL!]()
+        var responses = [LSStubResponseDSL?]()
         for URLString in testKeys {
         for URLString in testKeys {
             let response = stubRequest("GET", URLString).andReturn(200)?.withBody(testImageData)?.delay()
             let response = stubRequest("GET", URLString).andReturn(200)?.withBody(testImageData)?.delay()
             responses.append(response)
             responses.append(response)

+ 3 - 3
Tests/KingfisherTests/ImageProcessorTests.swift

@@ -215,7 +215,7 @@ extension ImageProcessorTests {
         
         
         let targetImages = filteredImageNames
         let targetImages = filteredImageNames
             .map { $0.replacingOccurrences(of: ".", with: "-\(specifiedSuffix).") }
             .map { $0.replacingOccurrences(of: ".", with: "-\(specifiedSuffix).") }
-            .flatMap { name -> Image? in
+            .compactMap { name -> Image? in
                 if #available(iOS 11, tvOS 11.0, macOS 10.13, *) {
                 if #available(iOS 11, tvOS 11.0, macOS 10.13, *) {
                     // Look for the version specified target first. Then roll back to base.
                     // Look for the version specified target first. Then roll back to base.
                     return Image(fileName: name.replacingOccurrences(of: ".", with: "-iOS11.")) ??
                     return Image(fileName: name.replacingOccurrences(of: ".", with: "-iOS11.")) ??
@@ -226,7 +226,7 @@ extension ImageProcessorTests {
                 return Image(fileName: name)
                 return Image(fileName: name)
             }
             }
         
         
-        let resultImages = imageData(noAlpha: noAlpha).flatMap { p.process(item: .data($0), options: []) }
+        let resultImages = imageData(noAlpha: noAlpha).compactMap { p.process(item: .data($0), options: []) }
         
         
         checkImagesEqual(targetImages: targetImages, resultImages: resultImages, for: specifiedSuffix)
         checkImagesEqual(targetImages: targetImages, resultImages: resultImages, for: specifiedSuffix)
     }
     }
@@ -264,7 +264,7 @@ extension ImageProcessorTests {
         
         
         let p = BlurImageProcessor(blurRadius: 4) >> RoundCornerImageProcessor(cornerRadius: 60)
         let p = BlurImageProcessor(blurRadius: 4) >> RoundCornerImageProcessor(cornerRadius: 60)
         let suffix = "blur-4-round-corner-60-mac"
         let suffix = "blur-4-round-corner-60-mac"
-        let resultImages = imageData().flatMap { p.process(item: .data($0), options: []) }
+        let resultImages = imageData().compactMap { p.process(item: .data($0), options: []) }
         for i in 0..<resultImages.count {
         for i in 0..<resultImages.count {
             resultImages[i].write(imageNames[i].replacingOccurrences(of: ".", with: "-\(suffix)."))
             resultImages[i].write(imageNames[i].replacingOccurrences(of: ".", with: "-\(suffix)."))
         }
         }