         let e = self.expectation()
         
         future {
-            Result(error: NSError(domain: "NaN", code: 0, userInfo: nil))
+            Result(error: TestError.Recoverable)
         }.recoverWith { _ in
             return future { _ in
                 fibonacci(5)

//    }
    
//    func testZipBothFail() {
//        let f = future { () -> Result<Int,NSError> in
//            Thread.sleep(1)
//            return Result(error: NSError(domain: "f-error", code: 3, userInfo: nil))
//        }
//        
//        let f1 = future { () -> Result<Int,NSError> in
//            Thread.sleep(1)
//            return Result(error: NSError(domain: "f1-error", code: 4, userInfo: nil))
//        }
//        
//        let e = self.expectation()
//        
//        f.zip(f1).onFailure { error in
//            XCTAssert(error.domain == "f-error")
//            XCTAssertEqual(error.code, 3)
//            e.fulfill()
//        }
//        

                XCTFail("success should not be called")
            }
        }
    }
    
    func testNSErrorThrow() {
        let completeExpectation = self.expectation(withDescription: "immediate complete")
        let failureExpectation = self.expectation(withDescription: "immediate failure")
        
        mQueue.sync {
            let error = NSError(domain: "test", code: 101, userInfo: nil)
            let f = future {
                throw error
            }
            f.onComplete { (result:Result<Void, NSError>) in
                switch result {
                case .Success(_):
                    XCTAssert(false)
                case .Failure(let err):
                    print("Error: \(err)")
                    XCTAssertEqual(err, error)
                }
                completeExpectation.fulfill()
            }
            
            f.onFailure { (err:NSError) in
                print("Error 2: \(err)")
                XCTAssert(err.isEqual(error))
                failureExpectation.fulfill()
            }
            
            f.onSuccess { value in
                XCTFail("success should not be called")
            }
        }
    }
    #endif
    
    func testFutureBasic() {
        let exp = self.expectation(withDescription: "6")
