Skip to content

Commit

Permalink
Update description for unfulfilled Promise
Browse files Browse the repository at this point in the history
  • Loading branch information
koher committed Oct 18, 2017
1 parent 8905cda commit 5054817
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/PromiseK/Promise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extension Promise : CustomStringConvertible {
if let value = self.value {
return "Promise(\(value))"
} else {
return "Promise"
return "Promise(\(Value.self))"
}
}
}
5 changes: 5 additions & 0 deletions Tests/PromiseKTests/PromiseKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ class PromiseKTests: XCTestCase {
XCTAssertEqual(obtained, .some(42))
}

func testDescription() {
XCTAssertEqual(Promise(42).description, "Promise(42)")
XCTAssertEqual(Promise<Int> { _ in }.description, "Promise(Int)")
}

func testFailableMap() {
do {
let squared = asyncGetOrFail(3, false).map {
Expand Down

0 comments on commit 5054817

Please sign in to comment.