 //
 
 private enum _XCTAssertion {
-    case Equal(Any, Any)
-    case EqualWithAccuracy(Any, Any, accuracy: Any)
-    case GreaterThan(Any, Any)
-    case GreaterThanOrEqual(Any, Any)
-    case LessThan(Any, Any)
-    case LessThanOrEqual(Any, Any)
-    case NotEqual(Any, Any)
-    case NotEqualWithAccuracy(Any, Any, accuracy: Any)
-    case Nil(Any)
+    case Equal
+    case EqualWithAccuracy
+    case GreaterThan
+    case GreaterThanOrEqual
+    case LessThan
+    case LessThanOrEqual
+    case NotEqual
+    case NotEqualWithAccuracy
+    case Nil
     case NotNil
     case True
     case False

// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information

        case .Fail: return nil
        }
    }
}

private enum _XCTAssertionResult {
    case Success
    case ExpectedFailure(String?)
    
    func failureDescription(assertion: _XCTAssertion) -> String {
        let explanation: String
        switch (self) {
        case .Success:
            explanation = "passed"
        case .ExpectedFailure(let details?):
            explanation = "failed: \(details)"
        case .ExpectedFailure(_):
            explanation = "failed"
        }

        if let name = assertion.name {
            return "\(name) \(explanation)"
        } else {
            return explanation
        }
    }
}

private func _XCTEvaluateAssertion(assertion: _XCTAssertion, @autoclosure message: () -> String = "", file: StaticString = __FILE__, line: UInt = __LINE__, @noescape expression: () -> _XCTAssertionResult) {
    let result = expression()
    
    switch result {
    case .Success:
        return
        
    default:
        if let handler = XCTFailureHandler {
            handler(XCTFailure(message: message(), failureDescription: result.failureDescription(assertion), expected: true, file: file, line: line))
        }
    }
}
