 
 // MARK: - Failure
 
+/// Logs a failed assertion.
+///
+/// Returns nil, for use in `x ?? failure(…)` expressions.
 func failure<T>(message: String, file: String = __FILE__, line: UInt = __LINE__) -> T? {
 	XCTFail(message, file: file, line: line)
 	return nil
 }
 
+/// Logs a failed assertion.
+///
+/// Returns nil, for use in `x ?? failure(…)` expressions.
 func failure(message: String, file: String = __FILE__, line: UInt = __LINE__) -> Bool {
 	XCTFail(message, file: file, line: line)
 	return false

	}
}

func assertEqual<T: Hashable, U: Equatable>(@autoclosure expression1: () -> [T: U]?, @autoclosure expression2: () -> [T: U]?, _ message: String = "", _ file: String = __FILE__, _ line: UInt = __LINE__) -> [T: U]? {
	let (actual, expected) = (expression1(), expression2())
	switch (actual, expected) {


// MARK: - Nil/non-nil

/// Asserts that a value is nil.
func assertNil<T>(@autoclosure expression: () -> T?, _ message: String = "", file: String = __FILE__, line: UInt = __LINE__) -> Bool {
	return expression().map { failure("\($0) is not nil. " + message, file: file, line: line) } ?? true
}

/// Asserts that a value is not nil.
func assertNotNil<T>(@autoclosure expression: () -> T?, _ message: String = "", file: String = __FILE__, line: UInt = __LINE__) -> T? {
	return expression() ?? failure("is nil. " + message, file: file, line: line)
}
