File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,11 @@ public struct PMKConfiguration {
6767 switch dispatcher {
6868 case nil :
6969 return CurrentThreadDispatcher ( )
70- case DispatchQueue . unspecified:
70+ case DispatchQueue . unspecified? :
7171 return nil // Do nothing
72- case DispatchQueue . default:
72+ case DispatchQueue . default? :
7373 return `default`
74- case DispatchQueue . chain:
74+ case DispatchQueue . chain? :
7575 fatalError ( " PromiseKit: .chain is not meaningful in the context of setDefaultDispatchers " )
7676 default :
7777 return dispatcher!
Original file line number Diff line number Diff line change @@ -130,3 +130,9 @@ extension Optional where Wrapped: DispatchQueue {
130130 return CurrentThreadDispatcher ( )
131131 }
132132}
133+
134+ extension DispatchQueue {
135+ static func ~= ( _ a: DispatchQueue , _ b: DispatchQueue ) -> Bool {
136+ return a === b
137+ }
138+ }
Original file line number Diff line number Diff line change @@ -61,9 +61,14 @@ class DispatcherTests: XCTestCase {
6161 conf. D = oldConf
6262 }
6363
64- func testPMKDefaultIdentity ( ) {
65- // If this identity does not hold, the DispatchQueue wrapper API will not behave correctly
64+ func testDispatchQueueIdentities ( ) {
65+ // If these identities does not hold, the DispatchQueue wrapper API will not behave correctly
6666 XCTAssert ( DispatchQueue . unspecified === DispatchQueue . unspecified, " DispatchQueues are not object-identity-preserving on this platform " )
67+ XCTAssert ( DispatchQueue . chain === DispatchQueue . chain, " DispatchQueues are not object-identity-preserving on this platform " )
68+ XCTAssert ( DispatchQueue . default === DispatchQueue . default, " DispatchQueues are not object-identity-preserving on this platform " )
69+ XCTAssert ( DispatchQueue . unspecified !== DispatchQueue . chain, " DispatchQueues are not object-identity-preserving on this platform " )
70+ XCTAssert ( DispatchQueue . chain !== DispatchQueue . default, " DispatchQueues are not object-identity-preserving on this platform " )
71+ XCTAssert ( DispatchQueue . default !== DispatchQueue . unspecified, " DispatchQueues are not object-identity-preserving on this platform " )
6772 }
6873
6974 func testDispatcherWithThrow( ) {
You can’t perform that action at this time.
0 commit comments