Skip to content

Commit

Permalink
Uncommented all
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPodymov committed Sep 18, 2024
1 parent 03d1900 commit 9255d25
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
6 changes: 1 addition & 5 deletions Sources/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum PMKError<T: Sendable>: Error {

/// `nil` was returned from `flatMap`
@available(*, deprecated, message: "See: `compactMap`")
case flatMap(T, T.Type)
case flatMap(Any, Any.Type)

/// `nil` was returned from `compactMap`
case compactMap(T)
Expand All @@ -37,10 +37,6 @@ public enum PMKError<T: Sendable>: Error {
case noWinner
}

//extension PMKError: Sendable {

//}

extension PMKError: CustomDebugStringConvertible {
public var debugDescription: String {
switch self {
Expand Down
14 changes: 10 additions & 4 deletions Tests/A+/2.3.1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ class Test231: XCTestCase {
return promise
}
promise.catch { err in
/*if case PMKError.returnedSelf = err {
switch err {
case PMKError<Void>.returnedSelf:
expectation.fulfill()
}*/
default:
break
}
}
}
specify("via return from a rejected promise") { d, expectation in
Expand All @@ -21,9 +24,12 @@ class Test231: XCTestCase {
return promise
}
promise.catch { err in
/*if case PMKError.returnedSelf = err {
switch err {
case PMKError<Void>.returnedSelf:
expectation.fulfill()
}*/
default:
break
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/CorePromise/ErrorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class PMKErrorTests: XCTestCase {
XCTAssertNotNil(PMKError<Void>.returnedSelf.errorDescription)
XCTAssertNotNil(PMKError<Void>.badInput.errorDescription)
XCTAssertNotNil(PMKError<Void>.cancelled.errorDescription)
//XCTAssertNotNil(PMKError.compactMap(1, Int.self).errorDescription)
XCTAssertNotNil(PMKError<Int>.compactMap(1).errorDescription)
XCTAssertNotNil(PMKError<Void>.emptySequence.errorDescription)
}

Expand All @@ -16,7 +16,7 @@ class PMKErrorTests: XCTestCase {
XCTAssertFalse(PMKError<Void>.returnedSelf.debugDescription.isEmpty)
XCTAssertNotNil(PMKError<Void>.badInput.debugDescription.isEmpty)
XCTAssertFalse(PMKError<Void>.cancelled.debugDescription.isEmpty)
// XCTAssertFalse(PMKError.compactMap(1, Int.self).debugDescription.isEmpty)
XCTAssertFalse(PMKError<Int>.compactMap(1).debugDescription.isEmpty)
XCTAssertFalse(PMKError<Void>.emptySequence.debugDescription.isEmpty)
}
}
1 change: 0 additions & 1 deletion Tests/CorePromise/RaceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class RaceTests: XCTestCase {
default:
return XCTFail()
}
//guard case PMKError.badInput = $0 else { return XCTFail() }
ex.fulfill()
}
wait(for: [ex], timeout: 10)
Expand Down
11 changes: 7 additions & 4 deletions Tests/CorePromise/ThenableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,14 @@ class ThenableTests: XCTestCase {
let ex = expectation(description: "")
Promise.value("a").compactMap {
Int($0)
}.catch { _ in
/*if case PMKError<Vo.compactMap = $0 {} else {
XCTFail()
}.catch {
switch $0 {
case PMKError<String>.compactMap:
break
default:
return XCTFail()
}
ex.fulfill()*/
ex.fulfill()
}
wait(for: [ex], timeout: 10)
}
Expand Down

0 comments on commit 9255d25

Please sign in to comment.