Revision control

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
import Shared
6
import XCTest
7
8
protocol Succeedable {
9
var isSuccess: Bool { get }
10
var isFailure: Bool { get }
11
}
12
13
extension Maybe: Succeedable {}
14
15
extension Deferred where T: Succeedable {
16
func succeeded() {
17
XCTAssertTrue(self.value.isSuccess)
18
}
19
20
func failed() {
21
XCTAssertTrue(self.value.isFailure)
22
}
23
}
24