Skip to content

Commit 9a5a710

Browse files
authored
Merge pull request #1223 from mxcl/v7-rc
--warnings; reduce deploy targets as poss
2 parents 66418a9 + 75aa70a commit 9a5a710

File tree

8 files changed

+32
-20
lines changed

8 files changed

+32
-20
lines changed

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import PackageDescription
44

55
let pkg = Package(name: "PromiseKit")
66
pkg.platforms = [
7-
.macOS(.v10_12), //FIXME strictly 10.10 (only tests need 10.12)
8-
.iOS(.v10), //FIXME strictly 8.0
9-
.tvOS(.v10), //FIXME strictly 9.0
7+
.macOS(.v10_10),
8+
.iOS(.v10), //FIXME strictly 8.0, but Tests require 10
9+
.tvOS(.v10), //FIXME strictly 9.0, but Tests require 10
1010
.watchOS(.v3)
1111
]
1212
pkg.swiftLanguageVersions = [.v5]

Sources/PMKCloudKit/CKContainer+Promise.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public extension CKContainer {
3232
}
3333

3434
/// Retrieves information about a single user based on the ID of the corresponding user record.
35+
@available(macOS 10.12, iOS 10, tvOS 10, *)
3536
func discoverUserIdentity(withUserRecordID recordID: CKRecord.ID) -> Promise<CKUserIdentity> {
3637
return Promise { discoverUserIdentity(withUserRecordID: recordID, completionHandler: $0.resolve) }
3738
}
@@ -43,6 +44,7 @@ public extension CKContainer {
4344
}
4445

4546
#if !os(tvOS)
47+
@available(macOS 10.12, iOS 10, tvOS 10, *)
4648
public extension CKContainer {
4749
func discoverAllIdentities() -> Promise<[CKUserIdentity]> {
4850
return Promise { discoverAllIdentities(completionHandler: $0.resolve) }

Tests/Cancel/CatchableTests.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,12 @@ extension CatchableTests {
470470
func testCatchOnly_Type_Ignored() {
471471
let x = expectation(description: #file + #function)
472472

473-
enum Foo: Swift.Error {}
473+
enum Foo: Swift.Error {
474+
case a
475+
}
474476

475477
Promise<Int>(error: Error.dummy).cancellize().catch(only: Foo.self) { _ in
476478
XCTFail()
477-
x.fulfill()
478479
}.catch { _ in
479480
x.fulfill()
480481
}
@@ -647,10 +648,12 @@ extension CatchableTests {
647648
func testRecoverOnly_Type_PatternMatch() {
648649
let x = expectation(description: #file + #function)
649650

650-
enum Foo: Swift.Error {}
651+
enum Foo: Swift.Error {
652+
case a
653+
}
651654

652655
Promise<Int>(error: Error.dummy).cancellize().recover(only: Foo.self) { _ in
653-
return Promise.value(1)
656+
Promise.value(1)
654657
}.done { _ in
655658
XCTFail()
656659
x.fulfill()

Tests/Core/CatchableTests.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,12 @@ extension CatchableTests {
334334
func testCatchOnly_Type_Ignored() {
335335
let x = expectation(description: #file + #function)
336336

337-
enum Foo: Swift.Error {}
337+
enum Foo: Swift.Error {
338+
case a
339+
}
338340

339341
Promise<Int>(error: Error.dummy).catch(only: Foo.self) { _ in
340342
XCTFail()
341-
x.fulfill()
342343
}.catch { _ in
343344
x.fulfill()
344345
}
@@ -507,10 +508,12 @@ extension CatchableTests {
507508
func testRecoverOnly_Type_PatternMatch() {
508509
let x = expectation(description: #file + #function)
509510

510-
enum Foo: Swift.Error {}
511+
enum Foo: Swift.Error {
512+
case a
513+
}
511514

512515
Promise<Int>(error: Error.dummy).recover(only: Foo.self) { _ in
513-
return Promise.value(1)
516+
Promise.value(1)
514517
}.done { _ in
515518
XCTFail()
516519
x.fulfill()

Tests/PMKCoreLocation/CLGeocoderTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CLGeocoderTests: XCTestCase {
2020
MockGeocoder().reverseGeocode(location: CLLocation()).done { x in
2121
XCTAssertEqual(x, [dummyPlacemark])
2222
ex.fulfill()
23-
}
23+
}.cauterize()
2424
waitForExpectations(timeout: 1)
2525
}
2626

@@ -37,7 +37,7 @@ class CLGeocoderTests: XCTestCase {
3737
MockGeocoder().geocode([:]).done { x in
3838
XCTAssertEqual(x, [dummyPlacemark])
3939
ex.fulfill()
40-
}
40+
}.cauterize()
4141
waitForExpectations(timeout: 1)
4242
}
4343

@@ -54,7 +54,7 @@ class CLGeocoderTests: XCTestCase {
5454
MockGeocoder().geocode("").done { x in
5555
XCTAssertEqual(x, [dummyPlacemark])
5656
ex.fulfill()
57-
}
57+
}.cauterize()
5858
waitForExpectations(timeout: 1)
5959
}
6060

@@ -74,7 +74,7 @@ class CLGeocoderTests: XCTestCase {
7474
MockGeocoder().geocodePostalAddress(CNPostalAddress()).done { x in
7575
XCTAssertEqual(x, [dummyPlacemark])
7676
ex.fulfill()
77-
}
77+
}.cauterize()
7878
waitForExpectations(timeout: 1)
7979
}
8080

@@ -93,7 +93,7 @@ class CLGeocoderTests: XCTestCase {
9393
MockGeocoder().geocodePostalAddress(CNPostalAddress(), preferredLocale: nil).done { x in
9494
XCTAssertEqual(x, [dummyPlacemark])
9595
ex.fulfill()
96-
}
96+
}.cauterize()
9797
waitForExpectations(timeout: 1)
9898
}
9999

@@ -112,7 +112,7 @@ class CLGeocoderTests: XCTestCase {
112112
MockGeocoder().reverseGeocode(location: CLLocation(), preferredLocale: nil).done { x in
113113
XCTAssertEqual(x, [dummyPlacemark])
114114
ex.fulfill()
115-
}
115+
}.cauterize()
116116
waitForExpectations(timeout: 1)
117117
}
118118
#endif

Tests/PMKCoreLocation/CLLocationManagerTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Test_CLLocationManager_Swift: XCTestCase {
1414
CLLocationManager.requestLocation().done { x in
1515
XCTAssertEqual(x, dummy)
1616
ex.fulfill()
17-
}
17+
}.cauterize()
1818

1919
waitForExpectations(timeout: 1)
2020
}
@@ -31,7 +31,7 @@ class Test_CLLocationManager_Swift: XCTestCase {
3131
CLLocationManager.requestLocation(satisfying: block).done({ locations in
3232
locations.forEach { XCTAssert(block($0) == true, "Block should be successful for returned values") }
3333
ex.fulfill()
34-
})
34+
}).cauterize()
3535
waitForExpectations(timeout: 1)
3636
}
3737
}

Tests/PMKHomeKit/HMAccessoryBrowserTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class HMAccessoryBrowserTests: XCTestCase {
2323
.done { accessories in
2424
XCTAssertEqual(accessories.count, 1)
2525
ex.fulfill()
26-
}
26+
}.cauterize()
2727

2828
waitForExpectations(timeout: 1, handler: nil)
2929
}

Tests/PMKMapKit/TestMapKit.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if !os(watchOS)
2+
13
import PromiseKit
24
import PMKMapKit
35
import MapKit
@@ -61,3 +63,5 @@ class Test_MKSnapshotter_Swift: XCTestCase {
6163
waitForExpectations(timeout: 1, handler: nil)
6264
}
6365
}
66+
67+
#endif

0 commit comments

Comments
 (0)