Skip to content

Commit b9f5396

Browse files
author
Mike Ferris
committed
Start of doc comments for assertions. Just XCTAssert so far.
1 parent 0459214 commit b9f5396

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

XCTest/XCTAssert.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88
//
99
//
1010
// XCTAssert.swift
11-
// Test assertion functions
1211
//
1312

13+
/**
14+
The primitive assertion function for XCTest. All other XCTAssert* functions are implemented in terms of this. This function emits a test failure if the gneeral Bool expression passed to it evaluates to false.
15+
- Parameter expression: A boolean test. If it evaluates to false, the assertion fails and emits a test failure.
16+
- Parameter message: An optional message to use in the failure if the assetion fails. If no message is supplied a default message is used.
17+
- Parameter file: The file name to use in the error message if the assertion fails. Default is the file containing the call to this function. It is rare to provide this parameter when calling tbhis function.
18+
- Parameter line: The line number to use in the error message if the assertion fails. Default is the line number of the call to this function in the calling file. It is rare to provide this parameter when calling this function.
19+
*/
1420
public func XCTAssert(@autoclosure expression: () -> BooleanType, _ message: String = "", file: StaticString = __FILE__, line: UInt = __LINE__) {
1521
if !expression().boolValue {
1622
if let test = XCTCurrentTestCase {

0 commit comments

Comments
 (0)